diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/net_processing.cpp | 5 | ||||
-rw-r--r-- | src/net_processing.h | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp index b046b3ac16..8963424c9b 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -695,6 +695,8 @@ private: /** Send `feefilter` message. */ void MaybeSendFeefilter(CNode& node, Peer& peer, std::chrono::microseconds current_time) EXCLUSIVE_LOCKS_REQUIRED(g_msgproc_mutex); + FastRandomContext m_rng GUARDED_BY(NetEventsInterface::g_msgproc_mutex); + const CChainParams& m_chainparams; CConnman& m_connman; AddrMan& m_addrman; @@ -1808,7 +1810,8 @@ std::unique_ptr<PeerManager> PeerManager::make(CConnman& connman, AddrMan& addrm PeerManagerImpl::PeerManagerImpl(CConnman& connman, AddrMan& addrman, BanMan* banman, ChainstateManager& chainman, CTxMemPool& pool, Options opts) - : m_chainparams(chainman.GetParams()), + : m_rng{opts.deterministic_rng}, + m_chainparams(chainman.GetParams()), m_connman(connman), m_addrman(addrman), m_banman(banman), diff --git a/src/net_processing.h b/src/net_processing.h index 837e308617..80d07648a4 100644 --- a/src/net_processing.h +++ b/src/net_processing.h @@ -58,6 +58,9 @@ public: uint32_t max_extra_txs{DEFAULT_BLOCK_RECONSTRUCTION_EXTRA_TXN}; //! Whether all P2P messages are captured to disk bool capture_messages{false}; + //! Whether or not the internal RNG behaves deterministically (this is + //! a test-only option). + bool deterministic_rng{false}; }; static std::unique_ptr<PeerManager> make(CConnman& connman, AddrMan& addrman, |