diff options
| author | MeshCollider <[email protected]> | 2017-09-09 00:20:00 +1200 |
|---|---|---|
| committer | MeshCollider <[email protected]> | 2017-09-11 22:15:44 +1200 |
| commit | df10edfd03fe4c9d1eca43a17ac4c54a14ac4832 (patch) | |
| tree | c8e054f7953af4a12b86e31fd80c830110240e11 /src/rpc/rawtransaction.cpp | |
| parent | Merge #11250: Bump wallet version to 159900 and remove the `usehd` option (diff) | |
| download | discoin-df10edfd03fe4c9d1eca43a17ac4c54a14ac4832.tar.xz discoin-df10edfd03fe4c9d1eca43a17ac4c54a14ac4832.zip | |
More user-friendly error message when partially signing
Diffstat (limited to 'src/rpc/rawtransaction.cpp')
| -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 a0322f67b..b2fc6a357 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(); |