let apps decide if they want to penalize peers on invalid topic

This commit is contained in:
Giovanni Petrantoni 2021-01-15 18:50:42 +09:00
parent 6542b913df
commit 1fb783eb7f
1 changed files with 0 additions and 2 deletions

View File

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