Skip to content

Commit

Permalink
mempool: tweak trace logs
Browse files Browse the repository at this point in the history
This improves trace logs related to transaction removal from the
mempool. During some debugging, they were found to be slightly
misleading in their current form.
  • Loading branch information
matheusd committed Aug 28, 2018
1 parent 083d446 commit 56f1981
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mempool/mempool.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,14 +301,15 @@ var _ mining.TxSource = (*TxPool)(nil)
// This function MUST be called with the mempool lock held (for writes).
func (mp *TxPool) removeOrphan(tx *dcrutil.Tx, removeRedeemers bool) {
txHash := tx.Hash()
log.Tracef("Removing orphan transaction %v", txHash)

// Nothing to do if passed tx is not an orphan.
tx, exists := mp.orphans[*txHash]
if !exists {
return
}

log.Tracef("Removing orphan transaction %v", txHash)

// Remove the reference from the previous orphan index.
for _, txIn := range tx.MsgTx().TxIn {
orphans, exists := mp.orphansByPrev[txIn.PreviousOutPoint]
Expand Down Expand Up @@ -584,6 +585,8 @@ func (mp *TxPool) removeTransaction(tx *dcrutil.Tx, removeRedeemers bool) {

// Remove the transaction if needed.
if txDesc, exists := mp.pool[*txHash]; exists {
log.Tracef("Removing transaction %v", txHash)

// Remove unconfirmed address index entries associated with the
// transaction if enabled.
if mp.cfg.AddrIndex != nil {
Expand Down

0 comments on commit 56f1981

Please sign in to comment.