mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02: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:
parent
5de2baa138
commit
76a76321d2
3 changed files with 12 additions and 80 deletions
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.
|
||||
//
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue