diff --git a/blockmanager.go b/blockmanager.go index 4f83ae3c6..23702087d 100644 --- a/blockmanager.go +++ b/blockmanager.go @@ -271,7 +271,7 @@ func (b *blockManager) handleTxMsg(tmsg *txMsg) { // Keep track of which peer the tx was sent from. txHash := tmsg.tx.Sha() - // If we didn't ask for this block then the peer is misbehaving. + // If we didn't ask for this transaction then the peer is misbehaving. if _, ok := tmsg.peer.requestedTxns[*txHash]; !ok { log.Warnf("BMGR: Got unrequested transaction %v from %s -- "+ "disconnecting", txHash, tmsg.peer.addr) diff --git a/mempool.go b/mempool.go index 8b5d5396d..abb47a3f5 100644 --- a/mempool.go +++ b/mempool.go @@ -616,7 +616,8 @@ func (mp *txMemPool) maybeAcceptTransaction(tx *btcutil.Tx, isOrphan *bool) erro } // Get the current height of the main chain. A standalone transaction - // will be mined into the next block at best, so + // will be mined into the next block at best, so it's height is at least + // one more than the current height. _, curHeight, err := mp.server.db.NewestSha() if err != nil { return err @@ -795,8 +796,7 @@ func (mp *txMemPool) ProcessTransaction(tx *btcutil.Tx) error { mp.Lock() defer mp.Unlock() - txHash := tx.Sha() - log.Tracef("TXMP: Processing transaction %v", txHash) + log.Tracef("TXMP: Processing transaction %v", tx.Sha()) // Potentially accept the transaction to the memory pool. var isOrphan bool @@ -809,7 +809,7 @@ func (mp *txMemPool) ProcessTransaction(tx *btcutil.Tx) error { // Accept any orphan transactions that depend on this // transaction (they are no longer orphans) and repeat for those // accepted transactions until there are no more. - err := mp.processOrphans(txHash) + err := mp.processOrphans(tx.Sha()) if err != nil { return err }