Browse Source

More user-friendly error message when partially signing

0.16
MeshCollider 7 years ago
parent
commit
df10edfd03
  1. 5
      src/rpc/rawtransaction.cpp

5
src/rpc/rawtransaction.cpp

@ -873,9 +873,14 @@ UniValue signrawtransaction(const JSONRPCRequest& request)
ScriptError serror = SCRIPT_ERR_OK; ScriptError serror = SCRIPT_ERR_OK;
if (!VerifyScript(txin.scriptSig, prevPubKey, &txin.scriptWitness, STANDARD_SCRIPT_VERIFY_FLAGS, TransactionSignatureChecker(&txConst, i, amount), &serror)) { if (!VerifyScript(txin.scriptSig, prevPubKey, &txin.scriptWitness, STANDARD_SCRIPT_VERIFY_FLAGS, TransactionSignatureChecker(&txConst, i, amount), &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)); TxInErrorToJSON(txin, vErrors, ScriptErrorString(serror));
} }
} }
}
bool fComplete = vErrors.empty(); bool fComplete = vErrors.empty();
UniValue result(UniValue::VOBJ); UniValue result(UniValue::VOBJ);

Loading…
Cancel
Save