Skip to content

Commit df10edf

Browse files
committed
More user-friendly error message when partially signing
1 parent c22a53c commit df10edf

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/rpc/rawtransaction.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -873,7 +873,12 @@ UniValue signrawtransaction(const JSONRPCRequest& request)
873873

874874
ScriptError serror = SCRIPT_ERR_OK;
875875
if (!VerifyScript(txin.scriptSig, prevPubKey, &txin.scriptWitness, STANDARD_SCRIPT_VERIFY_FLAGS, TransactionSignatureChecker(&txConst, i, amount), &serror)) {
876-
TxInErrorToJSON(txin, vErrors, ScriptErrorString(serror));
876+
if (serror == SCRIPT_ERR_INVALID_STACK_OPERATION) {
877+
// Unable to sign input and verification failed (possible attempt to partially sign).
878+
TxInErrorToJSON(txin, vErrors, "Unable to sign input, invalid stack size (possibly missing key)");
879+
} else {
880+
TxInErrorToJSON(txin, vErrors, ScriptErrorString(serror));
881+
}
877882
}
878883
}
879884
bool fComplete = vErrors.empty();

0 commit comments

Comments
 (0)