MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / CalculateAncestorData

Method CalculateAncestorData

src/txmempool.cpp:913–926  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

911}
912
913std::tuple<size_t, size_t, CAmount> CTxMemPool::CalculateAncestorData(const CTxMemPoolEntry& entry) const
914{
915 auto ancestors = m_txgraph->GetAncestors(entry, TxGraph::Level::MAIN);
916
917 size_t ancestor_count = ancestors.size();
918 size_t ancestor_size = 0;
919 CAmount ancestor_fees = 0;
920 for (auto tx: ancestors) {
921 const CTxMemPoolEntry& anc = static_cast<const CTxMemPoolEntry&>(*tx);
922 ancestor_size += anc.GetTxSize();
923 ancestor_fees += anc.GetModifiedFee();
924 }
925 return {ancestor_count, ancestor_size, ancestor_fees};
926}
927
928std::tuple<size_t, size_t, CAmount> CTxMemPool::CalculateDescendantData(const CTxMemPoolEntry& entry) const
929{

Callers 4

BOOST_FIXTURE_TEST_CASEFunction · 0.80
mempool.cppFile · 0.80
MiniMinerMethod · 0.80

Calls 4

GetAncestorsMethod · 0.80
sizeMethod · 0.45
GetTxSizeMethod · 0.45
GetModifiedFeeMethod · 0.45

Tested by 2

BOOST_FIXTURE_TEST_CASEFunction · 0.64