MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / EraseOrphansFor

Function EraseOrphansFor

src/net_processing.cpp:740–754  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

738}
739
740void EraseOrphansFor(NodeId peer)
741{
742 LOCK(g_cs_orphans);
743 int nErased = 0;
744 std::map<uint256, COrphanTx>::iterator iter = mapOrphanTransactions.begin();
745 while (iter != mapOrphanTransactions.end())
746 {
747 std::map<uint256, COrphanTx>::iterator maybeErase = iter++; // increment to avoid iterator becoming invalid
748 if (maybeErase->second.fromPeer == peer)
749 {
750 nErased += EraseOrphanTx(maybeErase->second.tx->GetHash());
751 }
752 }
753 if (nErased > 0) LogPrint(BCLog::MEMPOOL, "Erased %d orphan tx from peer=%d\n", nErased, peer);
754}
755
756
757unsigned int LimitOrphanTxSize(unsigned int nMaxOrphans)

Callers 2

FinalizeNodeMethod · 0.85
BOOST_AUTO_TEST_CASEFunction · 0.85

Calls 3

beginMethod · 0.45
endMethod · 0.45
GetHashMethod · 0.45

Tested by 1

BOOST_AUTO_TEST_CASEFunction · 0.68