mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-18 22:35:39 +01:00
Don't nuke witness data when signing fails
This commit is contained in:
@@ -217,7 +217,6 @@ bool ProduceSignature(const SigningProvider& provider, const BaseSignatureCreato
|
||||
bool solved = SignStep(provider, creator, fromPubKey, result, whichType, SigVersion::BASE, sigdata);
|
||||
bool P2SH = false;
|
||||
CScript subscript;
|
||||
sigdata.scriptWitness.stack.clear();
|
||||
|
||||
if (solved && whichType == TxoutType::SCRIPTHASH)
|
||||
{
|
||||
@@ -254,6 +253,7 @@ bool ProduceSignature(const SigningProvider& provider, const BaseSignatureCreato
|
||||
sigdata.witness = true;
|
||||
}
|
||||
|
||||
if (!sigdata.witness) sigdata.scriptWitness.stack.clear();
|
||||
if (P2SH) {
|
||||
result.push_back(std::vector<unsigned char>(subscript.begin(), subscript.end()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user