From a24db6c58409a425b4126c1e8e1f2a9c5a692a55 Mon Sep 17 00:00:00 2001 From: lanzafame Date: Fri, 28 Aug 2020 17:11:59 +1000 Subject: [PATCH] refactor block validate recordFailure func --- chain/sub/incoming.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/chain/sub/incoming.go b/chain/sub/incoming.go index d0bca9792..9a2d15c5c 100644 --- a/chain/sub/incoming.go +++ b/chain/sub/incoming.go @@ -263,8 +263,7 @@ func (bv *BlockValidator) Validate(ctx context.Context, pid peer.ID, msg *pubsub stats.Record(ctx, metrics.BlockReceived.M(1)) recordFailure := func(what string) { - ctx, _ = tag.New(ctx, tag.Insert(metrics.FailureType, what)) - stats.Record(ctx, metrics.BlockValidationFailure.M(1)) + recordFailure(ctx, metrics.BlockValidationFailure, what) bv.flagPeer(pid) }