rpc: handle "input not found" case in signrawtransaction

This commit is contained in:
Roy Lee 2022-08-04 20:34:47 -07:00
parent eff01c9e63
commit fd92031e27

View file

@ -1861,6 +1861,12 @@ func signRawTransaction(icmd interface{}, w *wallet.Wallet, chainClient *chain.R
if err != nil { if err != nil {
return nil, err return nil, err
} }
if result == nil {
return nil, &btcjson.RPCError{
Code: btcjson.ErrRPCNoTxInfo,
Message: "Input %s not found" + outPoint.String(),
}
}
script, err := hex.DecodeString(result.ScriptPubKey.Hex) script, err := hex.DecodeString(result.ScriptPubKey.Hex)
if err != nil { if err != nil {
return nil, err return nil, err