rpc: handle "input not found" case in signrawtransaction #11
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