[p2p] add TxDownloadOptions bool to make TxRequestTracker deterministic

Forward this bool to the TxRequestTracker ctor. This is needed for
stablity in TxDownloadManager fuzzers
pull/30110/head
glozow 2 months ago
parent f803c8ce8d
commit fa584cbe72

@ -1889,7 +1889,7 @@ PeerManagerImpl::PeerManagerImpl(CConnman& connman, AddrMan& addrman,
m_banman(banman),
m_chainman(chainman),
m_mempool(pool),
m_txdownloadman(node::TxDownloadOptions{pool, m_rng, opts.max_orphan_txs}),
m_txdownloadman(node::TxDownloadOptions{pool, m_rng, opts.max_orphan_txs, opts.deterministic_rng}),
m_warnings{warnings},
m_opts{opts}
{

@ -43,6 +43,8 @@ struct TxDownloadOptions {
FastRandomContext& m_rng;
/** Maximum number of transactions allowed in orphanage. */
const uint32_t m_max_orphan_txs;
/** Instantiate TxRequestTracker as deterministic (used for tests). */
bool m_deterministic_txrequest{false};
};
struct TxDownloadConnectionInfo {
/** Whether this peer is preferred for transaction download. */

@ -128,7 +128,7 @@ public:
return *m_lazy_recent_confirmed_transactions;
}
TxDownloadManagerImpl(const TxDownloadOptions& options) : m_opts{options} {}
TxDownloadManagerImpl(const TxDownloadOptions& options) : m_opts{options}, m_txrequest{options.m_deterministic_txrequest} {}
struct PeerInfo {
/** Information relevant to scheduling tx requests. */

Loading…
Cancel
Save