mirror of
https://github.com/vacp2p/nim-libp2p.git
synced 2025-01-27 17:05:59 +00:00
let apps decide if they want to penalize peers on invalid topic
This commit is contained in:
parent
6542b913df
commit
1fb783eb7f
@ -1034,8 +1034,6 @@ method subscribeTopic*(g: GossipSub,
|
|||||||
if subscribe and not(isNil(g.subscriptionValidator)) and not(g.subscriptionValidator(topic)):
|
if subscribe and not(isNil(g.subscriptionValidator)) and not(g.subscriptionValidator(topic)):
|
||||||
# this is a violation, so warn should be in order
|
# this is a violation, so warn should be in order
|
||||||
trace "ignoring invalid topic subscription", topic, peer
|
trace "ignoring invalid topic subscription", topic, peer
|
||||||
# also punish
|
|
||||||
peer.behaviourPenalty += 1
|
|
||||||
return
|
return
|
||||||
|
|
||||||
if subscribe:
|
if subscribe:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user