From e0e995d889ad5d69a6e20e04027413269c5bc1a8 Mon Sep 17 00:00:00 2001 From: vyzo Date: Wed, 16 Jan 2019 12:26:26 +0200 Subject: [PATCH] add check for blacklisted sources --- pubsub.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pubsub.go b/pubsub.go index 1a85642..790db65 100644 --- a/pubsub.go +++ b/pubsub.go @@ -607,6 +607,12 @@ func (p *PubSub) pushMsg(vals []*topicVal, src peer.ID, msg *Message) { return } + // even if they are forwarded by good peers + if _, ok := p.blacklist[msg.GetFrom()]; ok { + log.Warningf("dropping message from blacklisted source %s", src) + return + } + // reject unsigned messages when strict before we even process the id if p.signStrict && msg.Signature == nil { log.Debugf("dropping unsigned message from %s", src)