diff --git a/rpcserver.go b/rpcserver.go index e6faf2d7..a64f390f 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -1508,10 +1508,13 @@ func handleGetRawTransaction(s *rpcServer, cmd btcjson.Cmd, closeChan <-chan str tx, err := s.server.txMemPool.FetchTransaction(txSha) if err != nil { txList, err := s.server.db.FetchTxBySha(txSha) - if err != nil || len(txList) == 0 { + if err != nil { rpcsLog.Errorf("Error fetching tx: %v", err) return nil, btcjson.ErrNoTxInfo } + if len(txList) == 0 { + return nil, btcjson.ErrNoTxInfo + } lastTx := len(txList) - 1 mtx = txList[lastTx].Tx