Skip to content

Commit 5dca160

Browse files
Merge #6994: fix: skip ISDLOCK inv announcements for peers requesting recsigs
99e7997 fix: skip ISDLOCK inv announcements for peers requesting recsigs (pasta) Pull request description: ## Issue being fixed or feature implemented Masternode to masternode connections which share recovered signatures, should not share isdlocks; as these are higher level messages produced for users /consumers, which these masternodes can reconstruct from the recsig. To avoid wasted bandwidth and processing, we should skip sending isdlock invs to peers that we send recSigs to. ## What was done? Don't send inv for isdlocks for peers who request recsigs. ## How Has This Been Tested? ## Breaking Changes None ## Checklist: _Go over all the following points, and put an `x` in all the boxes that apply._ - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: UdjinM6: utACK 99e7997 kwvg: utACK 99e7997 Tree-SHA512: c74e6378943796bb1a5f362eb884ccce54edd78b1f47daa88c8b1e50847e2aa7f0ae57fb1b8c458431e8b9b2e5f95d2b2d8688f1bda9e56c337e6f893a07700a
2 parents 23de969 + 99e7997 commit 5dca160

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)