Release cs_main between individual private tx re-attempts

This queue may be hundreds to thousands of items, each of
which are being revalidated at short interval. Allow the
node to be more responsive in this scenario.

Github-Pull: #35406
Rebased-From: cbf8c107c1
This commit is contained in:
Greg Sanders
2026-06-29 10:18:20 -04:00
committed by fanquake
parent c1a0ed5225
commit cd32ebd3f4

View File

@@ -1649,8 +1649,9 @@ void PeerManagerImpl::ReattemptPrivateBroadcast(CScheduler& scheduler)
size_t num_for_rebroadcast{0};
const auto stale_txs = m_tx_for_private_broadcast.GetStale();
if (!stale_txs.empty()) {
LOCK(cs_main);
for (const auto& stale_tx : stale_txs) {
// Only hold lock per single submission
LOCK(cs_main);
auto mempool_acceptable = m_chainman.ProcessTransaction(stale_tx, /*test_accept=*/true);
if (mempool_acceptable.m_result_type == MempoolAcceptResult::ResultType::VALID) {
LogDebug(BCLog::PRIVBROADCAST,