refactor: VectorWriter without nVersion

The field is unused, so remove it.

This is also required for future commits.
This commit is contained in:
MarcoFalke
2023-11-16 12:59:43 +01:00
parent 98b0acda0f
commit fa0ed07941
9 changed files with 33 additions and 43 deletions

View File

@ -316,7 +316,7 @@ struct PSBTInput
const auto& [leaf_hashes, origin] = leaf_origin;
SerializeToVector(s, PSBT_IN_TAP_BIP32_DERIVATION, xonly);
std::vector<unsigned char> value;
CVectorWriter s_value{s.GetVersion(), value, 0};
VectorWriter s_value{value, 0};
s_value << leaf_hashes;
SerializeKeyOrigin(s_value, origin);
s << value;
@ -757,7 +757,7 @@ struct PSBTOutput
if (!m_tap_tree.empty()) {
SerializeToVector(s, PSBT_OUT_TAP_TREE);
std::vector<unsigned char> value;
CVectorWriter s_value{s.GetVersion(), value, 0};
VectorWriter s_value{value, 0};
for (const auto& [depth, leaf_ver, script] : m_tap_tree) {
s_value << depth;
s_value << leaf_ver;
@ -771,7 +771,7 @@ struct PSBTOutput
const auto& [leaf_hashes, origin] = leaf;
SerializeToVector(s, PSBT_OUT_TAP_BIP32_DERIVATION, xonly);
std::vector<unsigned char> value;
CVectorWriter s_value{s.GetVersion(), value, 0};
VectorWriter s_value{value, 0};
s_value << leaf_hashes;
SerializeKeyOrigin(s_value, origin);
s << value;