CPFP could work with this by turning individual transactions into “packages” of transactions whenever a parent pays more fees/KB than a child+parent. Removal would then remove the whole “package” in one go; there would never be a situation where removal was blocked.
That said, I’d be inclined to merge this pull-req first, then work on the fixes for the edge cases second.
On 11 July 2015 10:15:01 GMT-04:00, Pieter Wuille notifications@github.com wrote:
+bool CTxMemPool::StageTrimToSize(size_t sizelimit, const CAmount&
maxfeeremove, std::set& stage, CAmount& totalfeeremoved,
size_t& totalsizeremove) {
- size_t expsize = DynamicMemoryUsage();
- indexed_transaction_set::nth_index<1>::type::reverse_iterator it
= mapTx.get<1>().rbegin();
- while (expsize > sizelimit && it != mapTx.get<1>().rend()) {
-
std::deque<uint256> todo;
-
todo.push_back(it->GetTx().GetHash());
-
while (!todo.empty()) {
-
uint256 donow = todo.front();
-
const CTxMemPoolEntry\* origTx = &*mapTx.find(donow);
-
todo.pop_front();
-
if (!stage.count(donow)) {
-
stage.insert(donow);
-
totalfeeremoved += origTx->GetFee();
-
if (totalfeeremoved > maxfeeremove) {
-
return false;
(Efficient) code that implements CPFP will likely fix this, as I expect
that it will maintain caches of sizes/fees of children of transactions.
Reply to this email directly or view it on GitHub:
https://github.com/bitcoin/bitcoin/pull/6421/files#r34412978