further reduce code duplication
This commit is contained in:
parent
0254e4b365
commit
050a0ec5e4
@ -546,10 +546,9 @@ func (mv *MessageValidator) Validate(ctx context.Context, pid peer.ID, msg *pubs
|
|||||||
log.Debugf("failed to add message from network to message pool (From: %s, To: %s, Nonce: %d, Value: %s): %s", m.Message.From, m.Message.To, m.Message.Nonce, types.FIL(m.Message.Value), err)
|
log.Debugf("failed to add message from network to message pool (From: %s, To: %s, Nonce: %d, Value: %s): %s", m.Message.From, m.Message.To, m.Message.Nonce, types.FIL(m.Message.Value), err)
|
||||||
ctx, _ = tag.New(
|
ctx, _ = tag.New(
|
||||||
ctx,
|
ctx,
|
||||||
tag.Upsert(metrics.FailureType, "add"),
|
|
||||||
tag.Upsert(metrics.Local, "false"),
|
tag.Upsert(metrics.Local, "false"),
|
||||||
)
|
)
|
||||||
stats.Record(ctx, metrics.MessageValidationFailure.M(1))
|
recordFailure(ctx, metrics.MessageValidationFailure, "add")
|
||||||
switch {
|
switch {
|
||||||
case xerrors.Is(err, messagepool.ErrBroadcastAnyway):
|
case xerrors.Is(err, messagepool.ErrBroadcastAnyway):
|
||||||
fallthrough
|
fallthrough
|
||||||
|
Loading…
Reference in New Issue
Block a user