Merge pull request #11 from lbryio/roylee17/fix-signrawtransaction
rpc: handle "input not found" case in signrawtransaction
This commit is contained in:
commit
3e45c66f34
1 changed files with 6 additions and 0 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue