aboutsummaryrefslogtreecommitdiff
path: root/src/txmempool.h
diff options
context:
space:
mode:
authorglozow <gloriajzhao@gmail.com>2021-12-03 18:03:16 +0000
committerglozow <gloriajzhao@gmail.com>2022-01-18 11:55:06 +0000
commitc7cd98c7176800a51e6a6b3634a26b508aa33ff2 (patch)
tree9e0355708554754e1d984530b6d13adad471f372 /src/txmempool.h
parentd0bf9bb6a539f151ec92725d20a2b6c22cb095a5 (diff)
downloadbitcoin-c7cd98c7176800a51e6a6b3634a26b508aa33ff2.tar.xz
document and clean up MaybeUpdateMempoolForReorg
Co-authored-by: John Newbery <john@johnnewbery.com>
Diffstat (limited to 'src/txmempool.h')
-rw-r--r--src/txmempool.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/txmempool.h b/src/txmempool.h
index b8c508fd90..9fc3054e3c 100644
--- a/src/txmempool.h
+++ b/src/txmempool.h
@@ -599,10 +599,14 @@ public:
void addUnchecked(const CTxMemPoolEntry& entry, setEntries& setAncestors, bool validFeeEstimate = true) EXCLUSIVE_LOCKS_REQUIRED(cs, cs_main);
void removeRecursive(const CTransaction& tx, MemPoolRemovalReason reason) EXCLUSIVE_LOCKS_REQUIRED(cs);
- /** After reorg, check if mempool entries are now non-final, premature coinbase spends, or have
- * invalid lockpoints. Update lockpoints and remove entries (and descendants of entries) that
- * are no longer valid. */
- void removeForReorg(CChain& chain, std::function<bool(txiter)> check_final_and_mature) EXCLUSIVE_LOCKS_REQUIRED(cs, cs_main);
+ /** After reorg, filter the entries that would no longer be valid in the next block, and update
+ * the entries' cached LockPoints if needed. The mempool does not have any knowledge of
+ * consensus rules. It just appplies the callable function and removes the ones for which it
+ * returns true.
+ * @param[in] filter_final_and_mature Predicate that checks the relevant validation rules
+ * and updates an entry's LockPoints.
+ * */
+ void removeForReorg(CChain& chain, std::function<bool(txiter)> filter_final_and_mature) EXCLUSIVE_LOCKS_REQUIRED(cs, cs_main);
void removeConflicts(const CTransaction& tx) EXCLUSIVE_LOCKS_REQUIRED(cs);
void removeForBlock(const std::vector<CTransactionRef>& vtx, unsigned int nBlockHeight) EXCLUSIVE_LOCKS_REQUIRED(cs);