From ef180848f0c01c58351233eb535f975f2fd14a54 Mon Sep 17 00:00:00 2001 From: Enrique Jose Avila Asapche Date: Tue, 18 Jan 2022 17:04:05 +0300 Subject: [PATCH] Transaction is nil (#3273) * checks if txn is nil * returning nil, nil --- cmd/rpcdaemon/commands/eth_txs.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/rpcdaemon/commands/eth_txs.go b/cmd/rpcdaemon/commands/eth_txs.go index d72d6c22e..edfb679dd 100644 --- a/cmd/rpcdaemon/commands/eth_txs.go +++ b/cmd/rpcdaemon/commands/eth_txs.go @@ -81,6 +81,12 @@ func (api *APIImpl) GetTransactionByHash(ctx context.Context, hash common.Hash) if err != nil { return nil, err } + + // if no transactiion was found in the txpool then we return nil and an error warning that we didn't find the transaction by the hash + if txn == nil { + return nil, nil + } + return newRPCPendingTransaction(txn, curHeader, chainConfig), nil }