From e77831f1f9d23f34e5d3f7445b2b906282890330 Mon Sep 17 00:00:00 2001 From: cryptozoidberg Date: Tue, 1 Oct 2024 20:31:42 +0400 Subject: [PATCH] little tweak on wallet unconfirmed balance --- src/wallet/wallet2.cpp | 9 +++------ src/wallet/wallet_rpc_server.cpp | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 20745cdf..f7078763 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -3754,13 +3754,10 @@ bool wallet2::balance(std::unordered_mapsecond)) // if is_incoming == false, then we need to check for change and add it to total + if (it_employed_entry == subtransfers_by_assets_map.end() || !(it_employed_entry->second)) // if is_incoming == false, then we need to check for change and add it to total { + //it_employed_entry == subtransfers_by_assets_map.end() is a case when amount sent exactly equal amount received (someone producing more outputs for example) + //still need to add to total as it is a change wallet_public::asset_balance_entry_base& e = balances[emp_entry.asset_id]; e.total += emp_entry.amount; } diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp index 1a372db9..069e6856 100644 --- a/src/wallet/wallet_rpc_server.cpp +++ b/src/wallet/wallet_rpc_server.cpp @@ -1433,7 +1433,7 @@ namespace tools res.status = e.what(); return true; } - res.status = API_RETURN_CODE_OK; + res.status = API_RETURN_CODE_OK; return true; WALLET_RPC_CATCH_TRY_ENTRY(); }