mirror of
https://github.com/logos-messaging/go-libp2p-pubsub.git
synced 2026-01-07 07:13:13 +00:00
add check for blacklisted sources
This commit is contained in:
parent
1a05f13251
commit
e0e995d889
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user