mark peer for disconnection in connmgr
This commit is contained in:
parent
1dafcf24f1
commit
4f6ec225cf
@ -58,7 +58,10 @@ func HandleIncomingBlocks(mctx helpers.MetricsCtx, lc fx.Lifecycle, ps *pubsub.P
|
|||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
v := sub.NewBlockValidator(ps.BlacklistPeer)
|
v := sub.NewBlockValidator(func(p peer.ID) {
|
||||||
|
ps.BlacklistPeer(p)
|
||||||
|
h.ConnManager().TagPeer(p, "badblock", -1000)
|
||||||
|
})
|
||||||
|
|
||||||
if err := ps.RegisterTopicValidator(BlocksTopic, v.Validate); err != nil {
|
if err := ps.RegisterTopicValidator(BlocksTopic, v.Validate); err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
Loading…
Reference in New Issue
Block a user