diff options
author | Suhas Daftuar <sdaftuar@gmail.com> | 2015-10-21 10:18:24 -0400 |
---|---|---|
committer | Suhas Daftuar <sdaftuar@gmail.com> | 2016-03-14 12:13:31 -0400 |
commit | 76a76321d2f36992178ddaaf4d023c5e33c14fbf (patch) | |
tree | 05e6af5410f7cb9bd2f75d41bf14ff394df09c33 /src/txmempool.h | |
parent | 5de2baa138cda501038a4558bc169b2cfe5b7d6b (diff) |
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.
Diffstat (limited to 'src/txmempool.h')
-rw-r--r-- | src/txmempool.h | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/src/txmempool.h b/src/txmempool.h index da5a97649f..b1b6645a06 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -108,13 +108,6 @@ public: // modified fees with descendants. void UpdateFeeDelta(int64_t feeDelta); - /** We can set the entry to be dirty if doing the full calculation of in- - * mempool descendants will be too expensive, which can potentially happen - * when re-adding transactions from a block back to the mempool. - */ - void SetDirty(); - bool IsDirty() const { return nCountWithDescendants == 0; } - uint64_t GetCountWithDescendants() const { return nCountWithDescendants; } uint64_t GetSizeWithDescendants() const { return nSizeWithDescendants; } CAmount GetModFeesWithDescendants() const { return nModFeesWithDescendants; } @@ -138,12 +131,6 @@ struct update_descendant_state int64_t modifyCount; }; -struct set_dirty -{ - void operator() (CTxMemPoolEntry &e) - { e.SetDirty(); } -}; - struct update_fee_delta { update_fee_delta(int64_t _feeDelta) : feeDelta(_feeDelta) { } @@ -555,15 +542,11 @@ private: * updated and hence their state is already reflected in the parent * state). * - * If updating an entry requires looking at more than maxDescendantsToVisit - * transactions, outside of the ones in setExclude, then give up. - * * cachedDescendants will be updated with the descendants of the transaction * being updated, so that future invocations don't need to walk the * same transaction again, if encountered in another transaction chain. */ - bool UpdateForDescendants(txiter updateIt, - int maxDescendantsToVisit, + void UpdateForDescendants(txiter updateIt, cacheMap &cachedDescendants, const std::set<uint256> &setExclude); /** Update ancestors of hash to add/remove it as a descendant transaction. */ |