Merge pull request #11 from lbryio/roylee17/fix-signrawtransaction

rpc: handle "input not found" case in signrawtransaction
This commit is contained in:
Roy Lee 2022-08-04 22:04:03 -07:00 committed by GitHub
commit 3e45c66f34
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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