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

Method SanityCheck

src/node/mini_miner.cpp:231–242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

229}
230
231void MiniMiner::SanityCheck() const
232{
233 // m_entries, m_entries_by_txid, and m_descendant_set_by_txid all same size
234 Assume(m_entries.size() == m_entries_by_txid.size());
235 Assume(m_entries.size() == m_descendant_set_by_txid.size());
236 // Cached ancestor values should be at least as large as the transaction's own size
237 Assume(std::all_of(m_entries.begin(), m_entries.end(), [](const auto& entry) {
238 return entry->second.GetSizeWithAncestors() >= entry->second.GetTxSize();}));
239 // None of the entries should be to-be-replaced transactions
240 Assume(std::all_of(m_to_be_replaced.begin(), m_to_be_replaced.end(),
241 [&](const auto& txid){ return !m_entries_by_txid.contains(txid); }));
242}
243
244void MiniMiner::BuildMockTemplate(std::optional<CFeeRate> target_feerate)
245{

Callers 15

BOOST_AUTO_TEST_CASEFunction · 0.45
ForgetTxHashMethod · 0.45
ReceivedInvMethod · 0.45
DisconnectedPeerMethod · 0.45
RequestedTxMethod · 0.45
ReceivedResponseMethod · 0.45
CheckMethod · 0.45
BOOST_AUTO_TEST_CASEFunction · 0.45
TestFlushBehaviorMethod · 0.45
CheckInvariantsFunction · 0.45
FUZZ_TARGETFunction · 0.45
FUZZ_TARGETFunction · 0.45

Calls 6

GetSizeWithAncestorsMethod · 0.80
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
GetTxSizeMethod · 0.45
containsMethod · 0.45

Tested by 15

BOOST_AUTO_TEST_CASEFunction · 0.36
ForgetTxHashMethod · 0.36
ReceivedInvMethod · 0.36
DisconnectedPeerMethod · 0.36
RequestedTxMethod · 0.36
ReceivedResponseMethod · 0.36
CheckMethod · 0.36
BOOST_AUTO_TEST_CASEFunction · 0.36
TestFlushBehaviorMethod · 0.36
CheckInvariantsFunction · 0.36
FUZZ_TARGETFunction · 0.36
FUZZ_TARGETFunction · 0.36