forked from TrueCloudLab/neoneo-go
core: use errors.Is in PoolTx
Just in case.
This commit is contained in:
parent
4c38fae54c
commit
c19838ea67
1 changed files with 3 additions and 3 deletions
|
@ -1378,10 +1378,10 @@ func (bc *Blockchain) PoolTx(t *transaction.Transaction) error {
|
|||
return fmt.Errorf("%w: %v", ErrPolicy, err)
|
||||
}
|
||||
if err := bc.memPool.Add(t, bc); err != nil {
|
||||
switch err {
|
||||
case mempool.ErrOOM:
|
||||
switch {
|
||||
case errors.Is(err, mempool.ErrOOM):
|
||||
return ErrOOM
|
||||
case mempool.ErrDup:
|
||||
case errors.Is(err, mempool.ErrDup):
|
||||
return fmt.Errorf("mempool: %w", ErrAlreadyExists)
|
||||
default:
|
||||
return err
|
||||
|
|
Loading…
Reference in a new issue