aboutsummaryrefslogtreecommitdiff
path: root/src/validation.cpp
diff options
context:
space:
mode:
authorAnthony Towns <aj@erisian.com.au>2023-07-15 21:46:19 +1000
committerAnthony Towns <aj@erisian.com.au>2023-08-03 13:42:46 +1000
commita70beafdb22564043dc24fc98133fdadbaf77d8a (patch)
tree787f763689d64aa42b21468671f0c0165552e062 /src/validation.cpp
parent1e9684f39fba909b3501e9402d5b61f4bf744ff2 (diff)
validation: when adding txs due to a block reorg, allow immediate relay
Diffstat (limited to 'src/validation.cpp')
-rw-r--r--src/validation.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index 04c86e77c8..0efe6753ac 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -834,7 +834,10 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws)
}
}
- entry.reset(new CTxMemPoolEntry(ptx, ws.m_base_fees, nAcceptTime, m_active_chainstate.m_chain.Height(), m_pool.GetSequence(),
+ // Set entry_sequence to 0 when bypass_limits is used; this allows txs from a block
+ // reorg to be marked earlier than any child txs that were already in the mempool.
+ const uint64_t entry_sequence = bypass_limits ? 0 : m_pool.GetSequence();
+ entry.reset(new CTxMemPoolEntry(ptx, ws.m_base_fees, nAcceptTime, m_active_chainstate.m_chain.Height(), entry_sequence,
fSpendsCoinbase, nSigOpsCost, lock_points.value()));
ws.m_vsize = entry->GetTxSize();