@@ -349,8 +349,7 @@ void CTxMemPool::UpdateForRemoveFromMempool(const setEntries &entriesToRemove, b
349349 // mempool parents we'd calculate by searching, and it's important that
350350 // we use the cached notion of ancestor transactions as the set of
351351 // things to update for removal.
352- auto ancestors_result{CalculateMemPoolAncestors (entry, Limits::NoLimits (), /* fSearchForParents=*/ false )};
353- auto ancestors{std::move (ancestors_result).value_or (setEntries{})};
352+ auto ancestors{AssumeCalculateMemPoolAncestors (__func__, entry, Limits::NoLimits (), /* fSearchForParents=*/ false )};
354353 // Note that UpdateAncestorsOf severs the child links that point to
355354 // removeIt in the entries for the parents of removeIt.
356355 UpdateAncestorsOf (false , removeIt, ancestors);
@@ -703,8 +702,7 @@ void CTxMemPool::check(const CCoinsViewCache& active_coins_tip, int64_t spendhei
703702 assert (setParentCheck.size () == it->GetMemPoolParentsConst ().size ());
704703 assert (std::equal (setParentCheck.begin (), setParentCheck.end (), it->GetMemPoolParentsConst ().begin (), comp));
705704 // Verify ancestor state is correct.
706- auto ancestors_result{CalculateMemPoolAncestors (*it, Limits::NoLimits ())};
707- auto ancestors{std::move (ancestors_result).value_or (setEntries{})};
705+ auto ancestors{AssumeCalculateMemPoolAncestors (__func__, *it, Limits::NoLimits ())};
708706 uint64_t nCountCheck = ancestors.size () + 1 ;
709707 uint64_t nSizeCheck = it->GetTxSize ();
710708 CAmount nFeesCheck = it->GetModifiedFee ();
@@ -865,8 +863,7 @@ void CTxMemPool::PrioritiseTransaction(const uint256& hash, const CAmount& nFeeD
865863 if (it != mapTx.end ()) {
866864 mapTx.modify (it, [&nFeeDelta](CTxMemPoolEntry& e) { e.UpdateModifiedFee (nFeeDelta); });
867865 // Now update all ancestors' modified fees with descendants
868- auto ancestors_result{CalculateMemPoolAncestors (*it, Limits::NoLimits (), /* fSearchForParents=*/ false )};
869- auto ancestors{std::move (ancestors_result).value_or (setEntries{})};
866+ auto ancestors{AssumeCalculateMemPoolAncestors (__func__, *it, Limits::NoLimits (), /* fSearchForParents=*/ false )};
870867 for (txiter ancestorIt : ancestors) {
871868 mapTx.modify (ancestorIt, [=](CTxMemPoolEntry& e){ e.UpdateDescendantState (0 , nFeeDelta, 0 );});
872869 }
@@ -1004,8 +1001,7 @@ int CTxMemPool::Expire(std::chrono::seconds time)
10041001
10051002void CTxMemPool::addUnchecked (const CTxMemPoolEntry &entry, bool validFeeEstimate)
10061003{
1007- auto ancestors_result{CalculateMemPoolAncestors (entry, Limits::NoLimits ())};
1008- auto ancestors{std::move (ancestors_result).value_or (CTxMemPool::setEntries{})};
1004+ auto ancestors{AssumeCalculateMemPoolAncestors (__func__, entry, Limits::NoLimits ())};
10091005 return addUnchecked (entry, ancestors, validFeeEstimate);
10101006}
10111007
0 commit comments