mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 07:09:15 +01:00
Separate WitnessV1Taproot variant in CTxDestination
This commit is contained in:
@@ -242,13 +242,9 @@ bool ExtractDestination(const CScript& scriptPubKey, CTxDestination& addressRet)
|
||||
return true;
|
||||
}
|
||||
case TxoutType::WITNESS_V1_TAPROOT: {
|
||||
/* For now, no WitnessV1Taproot variant in CTxDestination exists, so map
|
||||
* this to WitnessUnknown. */
|
||||
WitnessUnknown unk;
|
||||
unk.version = 1;
|
||||
std::copy(vSolutions[0].begin(), vSolutions[0].end(), unk.program);
|
||||
unk.length = vSolutions[0].size();
|
||||
addressRet = unk;
|
||||
WitnessV1Taproot tap;
|
||||
std::copy(vSolutions[0].begin(), vSolutions[0].end(), tap.begin());
|
||||
addressRet = tap;
|
||||
return true;
|
||||
}
|
||||
case TxoutType::WITNESS_UNKNOWN: {
|
||||
@@ -337,6 +333,11 @@ public:
|
||||
return CScript() << OP_0 << ToByteVector(id);
|
||||
}
|
||||
|
||||
CScript operator()(const WitnessV1Taproot& tap) const
|
||||
{
|
||||
return CScript() << OP_1 << ToByteVector(tap);
|
||||
}
|
||||
|
||||
CScript operator()(const WitnessUnknown& id) const
|
||||
{
|
||||
return CScript() << CScript::EncodeOP_N(id.version) << std::vector<unsigned char>(id.program, id.program + id.length);
|
||||
|
||||
Reference in New Issue
Block a user