From 9d899c7b9fcd8b6c205d69efb1ea7ccdd91249e3 Mon Sep 17 00:00:00 2001 From: beer-1 <147697694+beer-1@users.noreply.github.com> Date: Wed, 17 Jul 2024 14:45:25 +0900 Subject: [PATCH] fix to return empty hash at error case --- jsonrpc/backend/tx.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jsonrpc/backend/tx.go b/jsonrpc/backend/tx.go index 89eea38..f4fee52 100644 --- a/jsonrpc/backend/tx.go +++ b/jsonrpc/backend/tx.go @@ -25,7 +25,11 @@ func (b *JSONRPCBackend) SendRawTransaction(input hexutil.Bytes) (common.Hash, e return common.Hash{}, err } - return tx.Hash(), b.SendTx(tx) + if err := b.SendTx(tx); err != nil { + return common.Hash{}, err + } + + return tx.Hash(), nil } func (b *JSONRPCBackend) SendTx(tx *coretypes.Transaction) error {