mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-03 11:41:48 +00:00
core: use error wrapping to provide more details
This commit is contained in:
parent
5ef08f60ae
commit
205f52c563
4 changed files with 18 additions and 18 deletions
|
@ -843,12 +843,12 @@ func (s *Server) relayBlocksLoop() {
|
|||
// verifyAndPoolTX verifies the TX and adds it to the local mempool.
|
||||
func (s *Server) verifyAndPoolTX(t *transaction.Transaction) RelayReason {
|
||||
if err := s.chain.PoolTx(t); err != nil {
|
||||
switch err {
|
||||
case core.ErrAlreadyExists:
|
||||
switch {
|
||||
case errors.Is(err, core.ErrAlreadyExists):
|
||||
return RelayAlreadyExists
|
||||
case core.ErrOOM:
|
||||
case errors.Is(err, core.ErrOOM):
|
||||
return RelayOutOfMemory
|
||||
case core.ErrPolicy:
|
||||
case errors.Is(err, core.ErrPolicy):
|
||||
return RelayPolicyFail
|
||||
default:
|
||||
return RelayInvalid
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue