nit: according to clang-format, this : goes on the next line? Also, you forgot to actually remove the (now unused/dead) rng ref to avoid the bug being re-introduced in the futre?
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index 6b6594f7da..34958d5e90 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -2139,3 +2139,3 @@ PeerManagerImpl::PeerManagerImpl(CConnman& connman, AddrMan& addrman,
m_mempool(pool),
- m_txdownloadman(node::TxDownloadOptions{pool, m_rng, opts.deterministic_rng}),
+ m_txdownloadman{node::TxDownloadOptions{pool, opts.deterministic_rng}},
m_warnings{warnings},
diff --git a/src/node/txdownloadman.h b/src/node/txdownloadman.h
index e362110212..ab6d9accbe 100644
--- a/src/node/txdownloadman.h
+++ b/src/node/txdownloadman.h
@@ -41,4 +41,2 @@ struct TxDownloadOptions {
const CTxMemPool& m_mempool;
- /** RNG provided by caller. */
- FastRandomContext& m_rng;
/** Instantiate TxRequestTracker as deterministic (used for tests). */
diff --git a/src/node/txdownloadman_impl.h b/src/node/txdownloadman_impl.h
index c65b2beed1..f49de20960 100644
--- a/src/node/txdownloadman_impl.h
+++ b/src/node/txdownloadman_impl.h
@@ -132,7 +132,7 @@ public:
- TxDownloadManagerImpl(const TxDownloadOptions& options) :
- m_mempool{options.m_mempool},
- m_rng{options.m_deterministic_txrequest},
- m_orphanage{MakeTxOrphanage()},
- m_txrequest{options.m_deterministic_txrequest}
+ TxDownloadManagerImpl(const TxDownloadOptions& options)
+ : m_mempool{options.m_mempool},
+ m_rng{options.m_deterministic_txrequest},
+ m_orphanage{MakeTxOrphanage()},
+ m_txrequest{options.m_deterministic_txrequest}
{}
diff --git a/src/test/fuzz/txdownloadman.cpp b/src/test/fuzz/txdownloadman.cpp
index c7a41da948..8de5664b69 100644
--- a/src/test/fuzz/txdownloadman.cpp
+++ b/src/test/fuzz/txdownloadman.cpp
@@ -176,4 +176,3 @@ FUZZ_TARGET(txdownloadman, .init = initialize)
CTxMemPool pool{MemPoolOptionsForTest(g_setup->m_node), error};
- FastRandomContext det_rand{true};
- node::TxDownloadManager txdownloadman{node::TxDownloadOptions{pool, det_rand, true}};
+ node::TxDownloadManager txdownloadman{node::TxDownloadOptions{.m_mempool = pool, .m_deterministic_txrequest = true}};
@@ -300,4 +299,3 @@ FUZZ_TARGET(txdownloadman_impl, .init = initialize)
CTxMemPool pool{MemPoolOptionsForTest(g_setup->m_node), error};
- FastRandomContext det_rand{true};
- node::TxDownloadManagerImpl txdownload_impl{node::TxDownloadOptions{pool, det_rand, true}};
+ node::TxDownloadManagerImpl txdownload_impl{node::TxDownloadOptions{.m_mempool = pool, .m_deterministic_txrequest = true}};
diff --git a/src/test/txdownload_tests.cpp b/src/test/txdownload_tests.cpp
index 296daf5fcf..00d824f50c 100644
--- a/src/test/txdownload_tests.cpp
+++ b/src/test/txdownload_tests.cpp
@@ -116,4 +116,3 @@ BOOST_FIXTURE_TEST_CASE(tx_rejection_types, TestChain100Setup)
CTxMemPool& pool = *Assert(m_node.mempool);
- FastRandomContext det_rand{true};
- node::TxDownloadOptions DEFAULT_OPTS{pool, det_rand, true};
+ node::TxDownloadOptions DEFAULT_OPTS{.m_mempool = pool, .m_deterministic_txrequest = true};
@@ -174,4 +173,3 @@ BOOST_FIXTURE_TEST_CASE(handle_missing_inputs, TestChain100Setup)
CTxMemPool& pool = *Assert(m_node.mempool);
- FastRandomContext det_rand{true};
- node::TxDownloadOptions DEFAULT_OPTS{pool, det_rand, true};
+ node::TxDownloadOptions DEFAULT_OPTS{.m_mempool = pool, .m_deterministic_txrequest = true};
NodeId nodeid{1};