diff options
author | Suhas Daftuar <sdaftuar@gmail.com> | 2017-04-03 15:50:15 -0400 |
---|---|---|
committer | Suhas Daftuar <sdaftuar@gmail.com> | 2017-04-03 15:50:15 -0400 |
commit | 9bef02e36525d0eed4e2e31678b3ff04bbb0b8cb (patch) | |
tree | b3f386b6691d084319ebd6432ebe84f643d5ecf0 /src/txmempool.cpp | |
parent | ba7dd8bf6f41de647a8df0c4570df6ac20b08e48 (diff) |
Bugfix: ancestor modifed fees were incorrect for descendants
If prioritisetransaction was called for a tx with in-mempool
descendants, the modified ancestor fee values for those descendants was
incorrect.
Diffstat (limited to 'src/txmempool.cpp')
-rw-r--r-- | src/txmempool.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/txmempool.cpp b/src/txmempool.cpp index 36a046ed2a..0794a3902f 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -912,6 +912,13 @@ void CTxMemPool::PrioritiseTransaction(const uint256& hash, const CAmount& nFeeD BOOST_FOREACH(txiter ancestorIt, setAncestors) { mapTx.modify(ancestorIt, update_descendant_state(0, nFeeDelta, 0)); } + // Now update all descendants' modified fees with ancestors + setEntries setDescendants; + CalculateDescendants(it, setDescendants); + setDescendants.erase(it); + BOOST_FOREACH(txiter descendantIt, setDescendants) { + mapTx.modify(descendantIt, update_ancestor_state(0, nFeeDelta, 0, 0)); + } } } LogPrintf("PrioritiseTransaction: %s feerate += %s\n", hash.ToString(), FormatMoney(nFeeDelta)); |