mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-09-11 21:20:39 +02:00
bugfix: give TxDownloadManager its own RNG
TxDownloadManagerImpl retains a reference to PeerManagerImpl::m_rng,
which is non-thread-safe and guarded by g_msgproc_mutex.
BlockConnected runs on the validation background thread while holding
only m_tx_download_mutex. Reconsidering an orphan with multiple
announcers could therefore use m_rng concurrently with message
processing.
Regression introduced in 9cc7dc50bd
This commit is contained in:
@@ -174,8 +174,7 @@ FUZZ_TARGET(txdownloadman, .init = initialize)
|
||||
// Initialize txdownloadman
|
||||
bilingual_str error;
|
||||
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}};
|
||||
|
||||
std::chrono::microseconds time{244466666};
|
||||
|
||||
@@ -298,8 +297,7 @@ FUZZ_TARGET(txdownloadman_impl, .init = initialize)
|
||||
// Initialize a TxDownloadManagerImpl
|
||||
bilingual_str error;
|
||||
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}};
|
||||
|
||||
std::chrono::microseconds time{244466666};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user