add check for blacklisted sources

This commit is contained in:
vyzo 2019-01-16 12:26:26 +02:00
parent 1a05f13251
commit e0e995d889
1 changed files with 6 additions and 0 deletions

View File

@ -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)