fix typos

This commit is contained in:
pengyonghui 2021-10-18 15:48:51 +08:00 committed by John C. Vernaleo
parent d590f3f77d
commit c56a053fdf

View file

@ -1054,7 +1054,7 @@ func (mp *TxPool) maybeAcceptTransaction(tx *btcutil.Tx, isNew, rateLimit, rejec
if entry == nil || entry.IsSpent() { if entry == nil || entry.IsSpent() {
// Must make a copy of the hash here since the iterator // Must make a copy of the hash here since the iterator
// is replaced and taking its address directly would // is replaced and taking its address directly would
// result in all of the entries pointing to the same // result in all the entries pointing to the same
// memory location and thus all be the final hash. // memory location and thus all be the final hash.
hashCopy := outpoint.Hash hashCopy := outpoint.Hash
missingParents = append(missingParents, &hashCopy) missingParents = append(missingParents, &hashCopy)
@ -1100,7 +1100,7 @@ func (mp *TxPool) maybeAcceptTransaction(tx *btcutil.Tx, isNew, rateLimit, rejec
if err != nil { if err != nil {
// Attempt to extract a reject code from the error so // Attempt to extract a reject code from the error so
// it can be retained. When not possible, fall back to // it can be retained. When not possible, fall back to
// a non standard error. // a non-standard error.
rejectCode, found := extractRejectCode(err) rejectCode, found := extractRejectCode(err)
if !found { if !found {
rejectCode = wire.RejectNonstandard rejectCode = wire.RejectNonstandard
@ -1143,7 +1143,7 @@ func (mp *TxPool) maybeAcceptTransaction(tx *btcutil.Tx, isNew, rateLimit, rejec
// calculated below on its own would encourage several small // calculated below on its own would encourage several small
// transactions to avoid fees rather than one single larger transaction // transactions to avoid fees rather than one single larger transaction
// which is more desirable. Therefore, as long as the size of the // which is more desirable. Therefore, as long as the size of the
// transaction does not exceeed 1000 less than the reserved space for // transaction does not exceed 1000 less than the reserved space for
// high-priority transactions, don't require a fee for it. // high-priority transactions, don't require a fee for it.
serializedSize := GetTxVirtualSize(tx) serializedSize := GetTxVirtualSize(tx)
minFee := calcMinRequiredTxRelayFee(serializedSize, minFee := calcMinRequiredTxRelayFee(serializedSize,
@ -1194,7 +1194,7 @@ func (mp *TxPool) maybeAcceptTransaction(tx *btcutil.Tx, isNew, rateLimit, rejec
mp.cfg.Policy.FreeTxRelayLimit*10*1000) mp.cfg.Policy.FreeTxRelayLimit*10*1000)
} }
// If the transaction has any conflicts and we've made it this far, then // If the transaction has any conflicts, and we've made it this far, then
// we're processing a potential replacement. // we're processing a potential replacement.
var conflicts map[chainhash.Hash]*btcutil.Tx var conflicts map[chainhash.Hash]*btcutil.Tx
if isReplacement { if isReplacement {
@ -1366,7 +1366,7 @@ func (mp *TxPool) ProcessOrphans(acceptedTx *btcutil.Tx) []*TxDesc {
// //
// It returns a slice of transactions added to the mempool. When the // It returns a slice of transactions added to the mempool. When the
// error is nil, the list will include the passed transaction itself along // error is nil, the list will include the passed transaction itself along
// with any additional orphan transaactions that were added as a result of // with any additional orphan transactions that were added as a result of
// the passed one being accepted. // the passed one being accepted.
// //
// This function is safe for concurrent access. // This function is safe for concurrent access.
@ -1435,7 +1435,7 @@ func (mp *TxPool) Count() int {
return count return count
} }
// TxHashes returns a slice of hashes for all of the transactions in the memory // TxHashes returns a slice of hashes for all the transactions in the memory
// pool. // pool.
// //
// This function is safe for concurrent access. // This function is safe for concurrent access.
@ -1488,7 +1488,7 @@ func (mp *TxPool) MiningDescs() []*mining.TxDesc {
return descs return descs
} }
// RawMempoolVerbose returns all of the entries in the mempool as a fully // RawMempoolVerbose returns all the entries in the mempool as a fully
// populated btcjson result. // populated btcjson result.
// //
// This function is safe for concurrent access. // This function is safe for concurrent access.