| 1634 | } |
| 1635 | |
| 1636 | void 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 | |
| 1656 | void PeerManagerImpl::ReattemptPrivateBroadcast(CScheduler& scheduler) |
| 1657 | { |
nothing calls this directly
no test coverage detected