Skip to content

Commit

Permalink
More user-friendly error message when partially signing
Browse files Browse the repository at this point in the history
  • Loading branch information
meshcollider committed Sep 11, 2017
1 parent c22a53c commit df10edf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/rpc/rawtransaction.cpp
Expand Up @@ -873,7 +873,12 @@ UniValue signrawtransaction(const JSONRPCRequest& request)

ScriptError serror = SCRIPT_ERR_OK;
if (!VerifyScript(txin.scriptSig, prevPubKey, &txin.scriptWitness, STANDARD_SCRIPT_VERIFY_FLAGS, TransactionSignatureChecker(&txConst, i, amount), &serror)) {
TxInErrorToJSON(txin, vErrors, ScriptErrorString(serror));
if (serror == SCRIPT_ERR_INVALID_STACK_OPERATION) {
// Unable to sign input and verification failed (possible attempt to partially sign).
TxInErrorToJSON(txin, vErrors, "Unable to sign input, invalid stack size (possibly missing key)");
} else {
TxInErrorToJSON(txin, vErrors, ScriptErrorString(serror));
}
}
}
bool fComplete = vErrors.empty();
Expand Down

0 comments on commit df10edf

Please sign in to comment.