Skip to content

Commit 99e7997

Browse files
fix: skip ISDLOCK inv announcements for peers requesting recsigs
1 parent 86e84d7 commit 99e7997

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/net_processing.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1188,6 +1188,13 @@ static void PushInv(Peer& peer, const CInv& inv)
11881188
return;
11891189
}
11901190

1191+
// Skip ISDLOCK inv announcements for peers that want recsigs, as they can reconstruct
1192+
// the islock from the recsig
1193+
if (inv.type == MSG_ISDLOCK && peer.m_wants_recsigs) {
1194+
LogPrint(BCLog::NET, "%s -- skipping ISDLOCK inv (peer wants recsigs): %s peer=%d\n", __func__, inv.ToString(), peer.m_id);
1195+
return;
1196+
}
1197+
11911198
LOCK(inv_relay->m_tx_inventory_mutex);
11921199
if (inv_relay->m_tx_inventory_known_filter.contains(inv.hash)) {
11931200
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)
62586265
if (islock == nullptr) continue;
62596266
uint256 isLockHash{::SerializeHash(*islock)};
62606267
tx_relay->m_tx_inventory_known_filter.insert(isLockHash);
6261-
queueAndMaybePushInv(CInv(MSG_ISDLOCK, isLockHash));
6268+
// Skip ISDLOCK inv announcements for peers that want recsigs, as they can reconstruct
6269+
// the islock from the recsig
6270+
if (!peer->m_wants_recsigs) {
6271+
queueAndMaybePushInv(CInv(MSG_ISDLOCK, isLockHash));
6272+
}
62626273
}
62636274

62646275
// Send an inv for the best ChainLock we have

0 commit comments

Comments
 (0)