From 99e7997acaf2c74562028060174cebd47eda2015 Mon Sep 17 00:00:00 2001 From: pasta Date: Wed, 19 Nov 2025 17:23:58 -0600 Subject: [PATCH] fix: skip ISDLOCK inv announcements for peers requesting recsigs --- src/net_processing.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 392d1d41ef35f..9778a0f638e21 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -1188,6 +1188,13 @@ static void PushInv(Peer& peer, const CInv& inv) return; } + // Skip ISDLOCK inv announcements for peers that want recsigs, as they can reconstruct + // the islock from the recsig + if (inv.type == MSG_ISDLOCK && peer.m_wants_recsigs) { + LogPrint(BCLog::NET, "%s -- skipping ISDLOCK inv (peer wants recsigs): %s peer=%d\n", __func__, inv.ToString(), peer.m_id); + return; + } + LOCK(inv_relay->m_tx_inventory_mutex); if (inv_relay->m_tx_inventory_known_filter.contains(inv.hash)) { LogPrint(BCLog::NET, "%s -- skipping known inv: %s peer=%d\n", __func__, inv.ToString(), peer.m_id); @@ -6258,7 +6265,11 @@ bool PeerManagerImpl::SendMessages(CNode* pto) if (islock == nullptr) continue; uint256 isLockHash{::SerializeHash(*islock)}; tx_relay->m_tx_inventory_known_filter.insert(isLockHash); - queueAndMaybePushInv(CInv(MSG_ISDLOCK, isLockHash)); + // Skip ISDLOCK inv announcements for peers that want recsigs, as they can reconstruct + // the islock from the recsig + if (!peer->m_wants_recsigs) { + queueAndMaybePushInv(CInv(MSG_ISDLOCK, isLockHash)); + } } // Send an inv for the best ChainLock we have