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

Method PeerLogicValidation

src/net_processing.cpp:843–856  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

841}
842
843PeerLogicValidation::PeerLogicValidation(CConnman* connmanIn, CScheduler &scheduler, bool enable_bip61)
844 : connman(connmanIn), m_stale_tip_check_time(0), m_enable_bip61(enable_bip61) {
845
846 // Initialize global variables that cannot be constructed at startup.
847 recentRejects.reset(new CRollingBloomFilter(120000, 0.000001));
848
849 const Consensus::Params& consensusParams = Params().GetConsensus();
850 // Stale tip checking and peer eviction are on two different timers, but we
851 // don't want them to get out of sync due to drift in the scheduler, so we
852 // combine them in one function and schedule at the quicker (peer-eviction)
853 // timer.
854 static_assert(EXTRA_PEER_CHECK_INTERVAL < STALE_CHECK_INTERVAL, "peer eviction timer should be less than stale tip check timer");
855 scheduler.scheduleEvery(std::bind(&PeerLogicValidation::CheckForStaleTipAndEvictPeers, this, consensusParams), EXTRA_PEER_CHECK_INTERVAL * 1000);
856}
857
858/**
859 * Evict orphan txn pool entries (EraseOrphanTx) based on a newly connected

Callers

nothing calls this directly

Calls 3

scheduleEveryMethod · 0.80
ParamsClass · 0.70
resetMethod · 0.45

Tested by

no test coverage detected