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