You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (!VerifyScript(txin.scriptSig, prevPubKey, &txin.scriptWitness, STANDARD_SCRIPT_VERIFY_FLAGS, TransactionSignatureChecker(&txConst, i, amount), &serror)) {
309
-
if (serror == SCRIPT_ERR_INVALID_STACK_OPERATION) {
310
-
// Unable to sign input and verification failed (possible attempt to partially sign).
SignatureData sigdata = DataFromTransaction(mtx, i, coin->second.out);
488
+
// Only sign SIGHASH_SINGLE if there's a corresponding output:
489
+
if (!fHashSingle || (i < mtx.vout.size())) {
490
+
ProduceSignature(*keystore, MutableTransactionSignatureCreator(&mtx, i, amount, nHashType), prevPubKey, sigdata);
491
+
}
492
+
493
+
UpdateInput(txin, sigdata);
494
+
495
+
// amount must be specified for valid segwit signature
496
+
if (amount == MAX_MONEY && !txin.scriptWitness.IsNull()) {
497
+
input_errors[i] = "Missing amount";
498
+
continue;
499
+
}
500
+
501
+
ScriptError serror = SCRIPT_ERR_OK;
502
+
if (!VerifyScript(txin.scriptSig, prevPubKey, &txin.scriptWitness, STANDARD_SCRIPT_VERIFY_FLAGS, TransactionSignatureChecker(&txConst, i, amount), &serror)) {
503
+
if (serror == SCRIPT_ERR_INVALID_STACK_OPERATION) {
504
+
// Unable to sign input and verification failed (possible attempt to partially sign).
0 commit comments