diff options
author | Samuel Dobson <dobsonsa68@gmail.com> | 2021-12-04 12:49:27 +1300 |
---|---|---|
committer | Samuel Dobson <dobsonsa68@gmail.com> | 2021-12-06 14:17:41 +1300 |
commit | a4fe70171b6fa570eda71d86b59d0fb24c2f0614 (patch) | |
tree | f2039c5b04f96fe6a4b347a2dd8ee034198b0677 /src/key_io.cpp | |
parent | 2fa4fd196176160a5ad0a25da173ff93252b8103 (diff) |
Make Bech32 LocateErrors return error list rather than using out-arg
Diffstat (limited to 'src/key_io.cpp')
-rw-r--r-- | src/key_io.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/key_io.cpp b/src/key_io.cpp index c89493e29d..3559f3a03d 100644 --- a/src/key_io.cpp +++ b/src/key_io.cpp @@ -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 |