aboutsummaryrefslogtreecommitdiff
path: root/src/script/standard.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/script/standard.cpp')
-rw-r--r--src/script/standard.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/script/standard.cpp b/src/script/standard.cpp
index 540aa0f2d9..0a233b550a 100644
--- a/src/script/standard.cpp
+++ b/src/script/standard.cpp
@@ -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);