Make Bech32 LocateErrors return error list rather than using out-arg

This commit is contained in:
Samuel Dobson
2021-12-04 12:49:27 +13:00
parent 2fa4fd1961
commit a4fe70171b
4 changed files with 22 additions and 23 deletions

View File

@@ -188,13 +188,9 @@ CTxDestination DecodeDestination(const std::string& str, const CChainParams& par
}
// Perform Bech32 error location
if (!error_locations) {
std::vector<int> dummy_errors;
error_str = bech32::LocateErrors(str, dummy_errors);
} else {
error_str = bech32::LocateErrors(str, *error_locations);
}
auto res = bech32::LocateErrors(str);
error_str = res.first;
if (error_locations) *error_locations = std::move(res.second);
return CNoDestination();
}
} // namespace