@@ -43,14 +43,14 @@ class DestinationEncoder : public boost::static_visitor<std::string>
43
43
std::string operator ()(const WitnessV0KeyHash& id) const
44
44
{
45
45
std::vector<unsigned char > data = {0 };
46
- ConvertBits<8 , 5 , true >(data, id.begin (), id.end ());
46
+ ConvertBits<8 , 5 , true >([&]( unsigned char c) { data. push_back (c); } , id.begin (), id.end ());
47
47
return bech32::Encode (m_params.Bech32HRP (), data);
48
48
}
49
49
50
50
std::string operator ()(const WitnessV0ScriptHash& id) const
51
51
{
52
52
std::vector<unsigned char > data = {0 };
53
- ConvertBits<8 , 5 , true >(data, id.begin (), id.end ());
53
+ ConvertBits<8 , 5 , true >([&]( unsigned char c) { data. push_back (c); } , id.begin (), id.end ());
54
54
return bech32::Encode (m_params.Bech32HRP (), data);
55
55
}
56
56
@@ -60,7 +60,7 @@ class DestinationEncoder : public boost::static_visitor<std::string>
60
60
return {};
61
61
}
62
62
std::vector<unsigned char > data = {(unsigned char )id.version };
63
- ConvertBits<8 , 5 , true >(data, id.program , id.program + id.length );
63
+ ConvertBits<8 , 5 , true >([&]( unsigned char c) { data. push_back (c); } , id.program , id.program + id.length );
64
64
return bech32::Encode (m_params.Bech32HRP (), data);
65
65
}
66
66
@@ -94,7 +94,7 @@ CTxDestination DecodeDestination(const std::string& str, const CChainParams& par
94
94
// Bech32 decoding
95
95
int version = bech.second [0 ]; // The first 5 bit symbol is the witness version (0-16)
96
96
// The rest of the symbols are converted witness program bytes.
97
- if (ConvertBits<5 , 8 , false >(data, bech.second .begin () + 1 , bech.second .end ())) {
97
+ if (ConvertBits<5 , 8 , false >([&]( unsigned char c) { data. push_back (c); } , bech.second .begin () + 1 , bech.second .end ())) {
98
98
if (version == 0 ) {
99
99
{
100
100
WitnessV0KeyHash keyid;
0 commit comments