rpc: handle "input not found" case in signrawtransaction #11

Merged
roylee17 merged 1 commit from roylee17/fix-signrawtransaction into master 2022-08-05 07:04:03 +02:00

View file

@ -1861,6 +1861,12 @@ func signRawTransaction(icmd interface{}, w *wallet.Wallet, chainClient *chain.R
if err != nil {
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)
if err != nil {
return nil, err