diff options
author | furszy <matiasfurszyfer@protonmail.com> | 2022-06-11 11:06:22 -0300 |
---|---|---|
committer | furszy <matiasfurszyfer@protonmail.com> | 2022-06-21 10:23:20 -0300 |
commit | 09649bc95d5f2855a54a8cf02e65215a3b333c92 (patch) | |
tree | 5fb9700427f6d7816f78327048832e2d3fe24deb /src/wallet/rpc/coins.cpp | |
parent | 192eb1e61c3c43baec7f32c498ab0ce0656a58f7 (diff) | |
download | bitcoin-09649bc95d5f2855a54a8cf02e65215a3b333c92.tar.xz |
refactor: implement general 'ListAddrBookAddresses' for addressbook destinations lookup
Diffstat (limited to 'src/wallet/rpc/coins.cpp')
-rw-r--r-- | src/wallet/rpc/coins.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/wallet/rpc/coins.cpp b/src/wallet/rpc/coins.cpp index 2649fa586c..6050ad7b4b 100644 --- a/src/wallet/rpc/coins.cpp +++ b/src/wallet/rpc/coins.cpp @@ -18,10 +18,10 @@ namespace wallet { static CAmount GetReceived(const CWallet& wallet, const UniValue& params, bool by_label) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet) { - std::set<CTxDestination> addresses; + std::vector<CTxDestination> addresses; if (by_label) { // Get the set of addresses assigned to label - addresses = wallet.GetLabelAddresses(LabelFromValue(params[0])); + addresses = wallet.ListAddrBookAddresses(CWallet::AddrBookFilter{LabelFromValue(params[0])}); if (addresses.empty()) throw JSONRPCError(RPC_WALLET_ERROR, "Label not found in wallet"); } else { // Get the address @@ -29,7 +29,7 @@ static CAmount GetReceived(const CWallet& wallet, const UniValue& params, bool b if (!IsValidDestination(dest)) { throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Bitcoin address"); } - addresses.insert(dest); + addresses.emplace_back(dest); } // Filter by own scripts only |