mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-16 13:01:19 +02:00
Merge 1c8b80f440 into merged_master (Bitcoin PR bitcoin/bitcoin#15294)
This commit is contained in:
commit
0761b58003
8 changed files with 27 additions and 20 deletions
|
|
@ -291,7 +291,6 @@ static bool SignStep(const SigningProvider& provider, const BaseSignatureCreator
|
|||
unsigned int flags)
|
||||
{
|
||||
CScript scriptRet;
|
||||
uint160 h160;
|
||||
ret.clear();
|
||||
std::vector<unsigned char> sig;
|
||||
|
||||
|
|
@ -320,8 +319,8 @@ static bool SignStep(const SigningProvider& provider, const BaseSignatureCreator
|
|||
ret.push_back(ToByteVector(pubkey));
|
||||
return true;
|
||||
}
|
||||
case TxoutType::SCRIPTHASH:
|
||||
h160 = uint160(vSolutions[0]);
|
||||
case TxoutType::SCRIPTHASH: {
|
||||
uint160 h160{vSolutions[0]};
|
||||
if (GetCScript(provider, sigdata, CScriptID{h160}, scriptRet)) {
|
||||
ret.push_back(std::vector<unsigned char>(scriptRet.begin(), scriptRet.end()));
|
||||
return true;
|
||||
|
|
@ -329,7 +328,7 @@ static bool SignStep(const SigningProvider& provider, const BaseSignatureCreator
|
|||
// Could not find redeemScript, add to missing
|
||||
sigdata.missing_redeem_script = h160;
|
||||
return false;
|
||||
|
||||
}
|
||||
case TxoutType::MULTISIG: {
|
||||
size_t required = vSolutions.front()[0];
|
||||
ret.push_back(valtype()); // workaround CHECKMULTISIG bug
|
||||
|
|
@ -355,8 +354,7 @@ static bool SignStep(const SigningProvider& provider, const BaseSignatureCreator
|
|||
return true;
|
||||
|
||||
case TxoutType::WITNESS_V0_SCRIPTHASH:
|
||||
CRIPEMD160().Write(vSolutions[0].data(), vSolutions[0].size()).Finalize(h160.begin());
|
||||
if (GetCScript(provider, sigdata, CScriptID{h160}, scriptRet)) {
|
||||
if (GetCScript(provider, sigdata, CScriptID{RIPEMD160(vSolutions[0])}, scriptRet)) {
|
||||
ret.push_back(std::vector<unsigned char>(scriptRet.begin(), scriptRet.end()));
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue