Check for 0 shas before dereferencing list
This commit is contained in:
parent
ced24946a4
commit
d81a2c9067
1 changed files with 1 additions and 1 deletions
|
@ -670,7 +670,7 @@ func handleGetRawTransaction(s *rpcServer, cmd btcjson.Cmd, walletNotification c
|
|||
// this point.
|
||||
txSha, _ := btcwire.NewShaHashFromStr(c.Txid)
|
||||
txList, err := s.server.db.FetchTxBySha(txSha)
|
||||
if err != nil {
|
||||
if err != nil || len(txList) == 0 {
|
||||
log.Errorf("RPCS: Error fetching tx: %v", err)
|
||||
return nil, btcjson.ErrNoTxInfo
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue