diff --git a/rpc/legacyrpc/methods.go b/rpc/legacyrpc/methods.go index 8889f121ec..e75ee3cbe8 100644 --- a/rpc/legacyrpc/methods.go +++ b/rpc/legacyrpc/methods.go @@ -1713,6 +1713,9 @@ func signRawTransaction(icmd interface{}, w *wallet.Wallet, chainClient *chain.R if err != nil { return nil, err } + if result == nil { + return nil, errors.New("the utxo has been spent") + } script, err := hex.DecodeString(result.ScriptPubKey.Hex) if err != nil { return nil, err