Skip to content

Commit 77b2b13

Browse files
committed
Do not handle IHAVEs for partial supporting peers
1 parent 31e80b4 commit 77b2b13

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

protocols/gossipsub/src/behaviour.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,6 +1376,20 @@ where
13761376
continue;
13771377
}
13781378

1379+
// We should not handle IHAVEs from peers that support partials on topics where we
1380+
// request partial messages.
1381+
#[cfg(feature = "partial_messages")]
1382+
if self
1383+
.partial_messages_extension
1384+
.opts(&topic)
1385+
.is_some_and(|opts| opts.requests_partial)
1386+
&& self
1387+
.partial_messages_extension
1388+
.supports_partial(peer_id, &topic)
1389+
{
1390+
continue;
1391+
}
1392+
13791393
for id in ids.into_iter().filter(|id| {
13801394
if self.duplicate_cache.contains(id) {
13811395
return false;

0 commit comments

Comments
 (0)