mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-08 10:31:50 -05:00
[net processing] PeerManager holds a FastRandomContext
This commit is contained in:
parent
dcf6230f92
commit
87c706713e
2 changed files with 7 additions and 1 deletions
|
@ -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),
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue