| 1211 | } |
| 1212 | |
| 1213 | void 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 | |
| 1234 | void PeerManagerImpl::FinalizeNode(const CNode& node) |
| 1235 | { |
nothing calls this directly
no test coverage detected