From ab6136efc1709bbbaacbe87b77787a30f774690a Mon Sep 17 00:00:00 2001 From: Bushstar Date: Thu, 16 Feb 2023 13:39:55 +0000 Subject: [PATCH] Only store last owner --- src/masternodes/rpc_accounts.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/masternodes/rpc_accounts.cpp b/src/masternodes/rpc_accounts.cpp index cfd04b8054e..a9df4f3193d 100644 --- a/src/masternodes/rpc_accounts.cpp +++ b/src/masternodes/rpc_accounts.cpp @@ -549,13 +549,13 @@ UniValue gettokenbalances(const JSONRPCRequest& request) { CCustomCSView mnview(*pcustomcsview); auto targetHeight = ::ChainActive().Height() + 1; - std::set calculatedOwners; + CScript calculatedOwner; mnview.ForEachBalance([&](CScript const & owner, CTokenAmount balance) { if (IsMineCached(*pwallet, owner)) { - if (calculatedOwners.count(owner) == 0) { + if (calculatedOwner != owner) { mnview.CalculateOwnerRewards(owner, targetHeight); - calculatedOwners.emplace(owner); + calculatedOwner = owner; } totalBalances.Add(balance); }