mark peer for disconnection in connmgr

This commit is contained in:
whyrusleeping 2020-02-18 09:20:17 -08:00
parent 1dafcf24f1
commit 4f6ec225cf

View File

@ -58,7 +58,10 @@ func HandleIncomingBlocks(mctx helpers.MetricsCtx, lc fx.Lifecycle, ps *pubsub.P
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 {
panic(err)