Skip to content

Commit 5966019

Browse files
committed
Collect decoded IDONTWANT messages
1 parent 1a41120 commit 5966019

File tree

1 file changed

+17
-2
lines changed
  • beacon_node/lighthouse_network/gossipsub/src

1 file changed

+17
-2
lines changed

beacon_node/lighthouse_network/gossipsub/src/protocol.rs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ use super::handler::HandlerEvent;
2323
use super::rpc_proto::proto;
2424
use super::topic::TopicHash;
2525
use super::types::{
26-
ControlAction, Graft, IHave, IWant, MessageId, PeerInfo, PeerKind, Prune, RawMessage, Rpc,
27-
Subscription, SubscriptionAction,
26+
ControlAction, Graft, IDontWant, IHave, IWant, MessageId, PeerInfo, PeerKind, Prune,
27+
RawMessage, Rpc, Subscription, SubscriptionAction,
2828
};
2929
use super::ValidationError;
3030
use asynchronous_codec::{Decoder, Encoder, Framed};
@@ -484,10 +484,25 @@ impl Decoder for GossipsubCodec {
484484
}));
485485
}
486486

487+
let idontwant_msgs: Vec<ControlAction> = rpc_control
488+
.idontwant
489+
.into_iter()
490+
.map(|idontwant| {
491+
ControlAction::IDontWant(IDontWant {
492+
message_ids: idontwant
493+
.message_ids
494+
.into_iter()
495+
.map(MessageId::from)
496+
.collect::<Vec<_>>(),
497+
})
498+
})
499+
.collect();
500+
487501
control_msgs.extend(ihave_msgs);
488502
control_msgs.extend(iwant_msgs);
489503
control_msgs.extend(graft_msgs);
490504
control_msgs.extend(prune_msgs);
505+
control_msgs.extend(idontwant_msgs);
491506
}
492507

493508
Ok(Some(HandlerEvent::Message {

0 commit comments

Comments
 (0)