core/txpool: elevate the 'already reserved' error into a constant (#29095)
declare the 'already reserved' error in errors.go
This commit is contained in:
parent
5a0f468f8c
commit
51b479e564
@ -54,4 +54,10 @@ var (
|
|||||||
// ErrFutureReplacePending is returned if a future transaction replaces a pending
|
// ErrFutureReplacePending is returned if a future transaction replaces a pending
|
||||||
// one. Future transactions should only be able to replace other future transactions.
|
// one. Future transactions should only be able to replace other future transactions.
|
||||||
ErrFutureReplacePending = errors.New("future transaction tries to replace pending")
|
ErrFutureReplacePending = errors.New("future transaction tries to replace pending")
|
||||||
|
|
||||||
|
// ErrAlreadyReserved is returned if the sender address has a pending transaction
|
||||||
|
// in a different subpool. For example, this error is returned in response to any
|
||||||
|
// input transaction of non-blob type when a blob transaction from this sender
|
||||||
|
// remains pending (and vice-versa).
|
||||||
|
ErrAlreadyReserved = errors.New("address already reserved")
|
||||||
)
|
)
|
||||||
|
@ -122,7 +122,7 @@ func (p *TxPool) reserver(id int, subpool SubPool) AddressReserver {
|
|||||||
log.Error("pool attempted to reserve already-owned address", "address", addr)
|
log.Error("pool attempted to reserve already-owned address", "address", addr)
|
||||||
return nil // Ignore fault to give the pool a chance to recover while the bug gets fixed
|
return nil // Ignore fault to give the pool a chance to recover while the bug gets fixed
|
||||||
}
|
}
|
||||||
return errors.New("address already reserved")
|
return ErrAlreadyReserved
|
||||||
}
|
}
|
||||||
p.reservations[addr] = subpool
|
p.reservations[addr] = subpool
|
||||||
if metrics.Enabled {
|
if metrics.Enabled {
|
||||||
|
Loading…
Reference in New Issue
Block a user