From 4c53599b672ec1317fb67ddeea7d4caedab97ae7 Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Wed, 25 Feb 2015 22:01:20 -0600 Subject: [PATCH] mempool: Loosen restrictions for resurrected txns. This modifies the recently added code which rejects free/low-fee transactions with insufficient priority to ignore resurrected transactions from disconnected blocks. It also exempts resurrected transactions from the free/low-fee rate limiting. --- blockmanager.go | 2 +- mempool.go | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/blockmanager.go b/blockmanager.go index f53216ef..7000840f 100644 --- a/blockmanager.go +++ b/blockmanager.go @@ -1162,7 +1162,7 @@ func (b *blockManager) handleNotifyMsg(notification *blockchain.Notification) { // the transaction pool. for _, tx := range block.Transactions()[1:] { _, err := b.server.txMemPool.MaybeAcceptTransaction(tx, - false, true) + false, false) if err != nil { // Remove the transaction and all transactions // that depend on it if it wasn't accepted into diff --git a/mempool.go b/mempool.go index 6da0293c..4a2b9f58 100644 --- a/mempool.go +++ b/mempool.go @@ -1180,8 +1180,10 @@ func (mp *txMemPool) maybeAcceptTransaction(tx *btcutil.Tx, isNew, rateLimit boo } // Require that free transactions have sufficient priority to be mined - // in the next block. - if !cfg.NoRelayPriority && txFee < minFee { + // in the next block. Transactions which are being added back to the + // memory pool from blocks that have been disconnected during a reorg + // are exempted. + if isNew && !cfg.NoRelayPriority && txFee < minFee { txD := &TxDesc{ Tx: tx, Added: time.Now(),