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

Method ReattemptInitialBroadcast

src/net_processing.cpp:1636–1654  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1634}
1635
1636void PeerManagerImpl::ReattemptInitialBroadcast(CScheduler& scheduler)
1637{
1638 std::set<Txid> unbroadcast_txids = m_mempool.GetUnbroadcastTxs();
1639
1640 for (const auto& txid : unbroadcast_txids) {
1641 CTransactionRef tx = m_mempool.get(txid);
1642
1643 if (tx != nullptr) {
1644 InitiateTxBroadcastToAll(txid, tx->GetWitnessHash());
1645 } else {
1646 m_mempool.RemoveUnbroadcastTx(txid, true);
1647 }
1648 }
1649
1650 // Schedule next run for 10-15 minutes in the future.
1651 // We add randomness on every cycle to avoid the possibility of P2P fingerprinting.
1652 const auto delta = 10min + FastRandomContext().randrange<std::chrono::milliseconds>(5min);
1653 scheduler.scheduleFromNow([&] { ReattemptInitialBroadcast(scheduler); }, delta);
1654}
1655
1656void PeerManagerImpl::ReattemptPrivateBroadcast(CScheduler& scheduler)
1657{

Callers

nothing calls this directly

Calls 4

GetUnbroadcastTxsMethod · 0.80
RemoveUnbroadcastTxMethod · 0.80
FastRandomContextClass · 0.70
getMethod · 0.45

Tested by

no test coverage detected