mirror of
https://github.com/QuilibriumNetwork/ceremonyclient.git
synced 2026-02-25 12:27:24 +08:00
blossomsub: Avoid looping back unwanted messages (#384)
This commit is contained in:
parent
86997630f0
commit
2c79fedfd0
@ -912,6 +912,13 @@ func (bs *BlossomSubRouter) handleIWant(p peer.ID, ctl *pb.ControlMessage) []*pb
|
||||
|
||||
msgs := make([]*pb.Message, 0, len(ihave))
|
||||
for _, msg := range ihave {
|
||||
if peer.ID(msg.GetFrom()) == p {
|
||||
continue
|
||||
}
|
||||
mid := bs.p.idGen.RawID(msg)
|
||||
if _, ok := bs.unwanted[p][string(mid)]; ok {
|
||||
continue
|
||||
}
|
||||
msgs = append(msgs, msg)
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user