named error for too many pending messages
This commit is contained in:
parent
6abfbbddd5
commit
82ef0529d8
@ -67,6 +67,7 @@ var (
|
||||
|
||||
ErrSoftValidationFailure = errors.New("validation failure")
|
||||
ErrRBFTooLowPremium = errors.New("replace by fee has too low GasPremium")
|
||||
ErrTooManyPendingMessages = errors.New("too many pending messages for actor")
|
||||
|
||||
ErrTryAgain = errors.New("state inconsistency while pushing message; please try again")
|
||||
)
|
||||
@ -165,8 +166,7 @@ func (ms *msgSet) add(m *types.SignedMessage, mp *MessagePool) (bool, error) {
|
||||
}
|
||||
|
||||
if !has && len(ms.msgs) > MaxActorPendingMessages {
|
||||
return false, xerrors.Errorf("too many pending messages for actor in the mpool: %w",
|
||||
ErrSoftValidationFailure)
|
||||
return false, ErrTooManyPendingMessages
|
||||
}
|
||||
|
||||
ms.msgs[m.Message.Nonce] = m
|
||||
|
@ -549,6 +549,8 @@ func (mv *MessageValidator) Validate(ctx context.Context, pid peer.ID, msg *pubs
|
||||
fallthrough
|
||||
case xerrors.Is(err, messagepool.ErrRBFTooLowPremium):
|
||||
fallthrough
|
||||
case xerrors.Is(err, messagepool.ErrTooManyPendingMessages):
|
||||
fallthrough
|
||||
case xerrors.Is(err, messagepool.ErrNonceTooLow):
|
||||
return pubsub.ValidationIgnore
|
||||
default:
|
||||
|
Loading…
Reference in New Issue
Block a user