mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 14:53:43 +01:00
Remove work limit in UpdateForDescendants()
The work limit served to prevent the descendant walking algorithm from doing too much work by marking the parent transaction as dirty. However to implement ancestor tracking, it's not possible to similarly mark those descendant transactions as dirty without having to calculate them to begin with. This commit removes the work limit altogether. With appropriate chain limits (-limitdescendantcount) the concern about doing too much work inside this function should be mitigated.
This commit is contained in:
14
src/main.cpp
14
src/main.cpp
@@ -1194,20 +1194,6 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C
|
||||
// Save these to avoid repeated lookups
|
||||
setIterConflicting.insert(mi);
|
||||
|
||||
// If this entry is "dirty", then we don't have descendant
|
||||
// state for this transaction, which means we probably have
|
||||
// lots of in-mempool descendants.
|
||||
// Don't allow replacements of dirty transactions, to ensure
|
||||
// that we don't spend too much time walking descendants.
|
||||
// This should be rare.
|
||||
if (mi->IsDirty()) {
|
||||
return state.DoS(0, false,
|
||||
REJECT_NONSTANDARD, "too many potential replacements", false,
|
||||
strprintf("too many potential replacements: rejecting replacement %s; cannot replace tx %s with untracked descendants",
|
||||
hash.ToString(),
|
||||
mi->GetTx().GetHash().ToString()));
|
||||
}
|
||||
|
||||
// Don't allow the replacement to reduce the feerate of the
|
||||
// mempool.
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user