diff options
author | MeshCollider <dobsonsa68@gmail.com> | 2017-09-09 00:20:00 +1200 |
---|---|---|
committer | MeshCollider <dobsonsa68@gmail.com> | 2017-09-11 22:15:44 +1200 |
commit | df10edfd03fe4c9d1eca43a17ac4c54a14ac4832 (patch) | |
tree | c8e054f7953af4a12b86e31fd80c830110240e11 | |
parent | c22a53cd6351b3f0e96de971b001ad712b83fc47 (diff) |
More user-friendly error message when partially signing
-rw-r--r-- | src/rpc/rawtransaction.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index a0322f67b4..b2fc6a357a 100644 --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -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(); |