Commit ea314605 authored by vyzo's avatar vyzo

don't forward messages with source ourselves but not published by ourselves

per stebalien's request.
parent 0cab7f5e
......@@ -556,6 +556,12 @@ func (gs *GossipSubRouter) connector() {
}
func (gs *GossipSubRouter) Publish(msg *Message) {
self := gs.p.host.ID()
if peer.ID(msg.GetFrom()) == self && msg.ReceivedFrom != self {
// we don't forward messages claiming to be from us but not published by ourselves
return
}
gs.mcache.Put(msg.Message)
from := msg.ReceivedFrom
......@@ -567,7 +573,7 @@ func (gs *GossipSubRouter) Publish(msg *Message) {
continue
}
if gs.floodPublish && from == gs.p.host.ID() {
if gs.floodPublish && from == self {
for p := range tmap {
if gs.score.Score(p) >= gs.publishThreshold {
tosend[p] = struct{}{}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment