MCPcopy Create free account
hub / github.com/ElementsProject/elements / ReattemptInitialBroadcast

Method ReattemptInitialBroadcast

src/net_processing.cpp:1213–1232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1211}
1212
1213void PeerManagerImpl::ReattemptInitialBroadcast(CScheduler& scheduler)
1214{
1215 std::set<uint256> unbroadcast_txids = m_mempool.GetUnbroadcastTxs();
1216
1217 for (const auto& txid : unbroadcast_txids) {
1218 CTransactionRef tx = m_mempool.get(txid);
1219
1220 if (tx != nullptr) {
1221 LOCK(cs_main);
1222 _RelayTransaction(txid, tx->GetWitnessHash());
1223 } else {
1224 m_mempool.RemoveUnbroadcastTx(txid, true);
1225 }
1226 }
1227
1228 // Schedule next run for 10-15 minutes in the future.
1229 // We add randomness on every cycle to avoid the possibility of P2P fingerprinting.
1230 const std::chrono::milliseconds delta = 10min + GetRandMillis(5min);
1231 scheduler.scheduleFromNow([&] { ReattemptInitialBroadcast(scheduler); }, delta);
1232}
1233
1234void PeerManagerImpl::FinalizeNode(const CNode& node)
1235{

Callers

nothing calls this directly

Calls 4

GetUnbroadcastTxsMethod · 0.80
RemoveUnbroadcastTxMethod · 0.80
scheduleFromNowMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected