Skip to content

Commit cbf8c10

Browse files
committed
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.
1 parent 5aea3d0 commit cbf8c10

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎src/net_processing.cpp‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1660,8 +1660,9 @@ void PeerManagerImpl::ReattemptPrivateBroadcast(CScheduler& scheduler)
16601660
size_t num_for_rebroadcast{0};
16611661
const auto stale_txs = m_tx_for_private_broadcast.GetStale();
16621662
if (!stale_txs.empty()) {
1663-
LOCK(cs_main);
16641663
for (const auto& stale_tx : stale_txs) {
1664+
// Only hold lock per single submission
1665+
LOCK(cs_main);
16651666
auto mempool_acceptable = m_chainman.ProcessTransaction(stale_tx, /*test_accept=*/true);
16661667
if (mempool_acceptable.m_result_type == MempoolAcceptResult::ResultType::VALID) {
16671668
LogDebug(BCLog::PRIVBROADCAST,

0 commit comments

Comments
 (0)