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:
Greg Sanders
2026-08-25 08:30:33 -04:00
parent 794a753958
commit 80eaa6cabf
6 changed files with 18 additions and 17 deletions

View File

@@ -2137,7 +2137,7 @@ PeerManagerImpl::PeerManagerImpl(CConnman& connman, AddrMan& addrman,
m_banman(banman),
m_chainman(chainman),
m_mempool(pool),
m_txdownloadman(node::TxDownloadOptions{pool, m_rng, opts.deterministic_rng}),
m_txdownloadman{node::TxDownloadOptions{pool, opts.deterministic_rng}},
m_warnings{warnings},
m_opts{opts},
m_inbound_inv_bucket(/*rate=*/m_opts.tx_send_rate, /*mult=*/1.0),