diff --git a/src/masternodes/rpc_accounts.cpp b/src/masternodes/rpc_accounts.cpp index 3569667fcd..ebae487337 100644 --- a/src/masternodes/rpc_accounts.cpp +++ b/src/masternodes/rpc_accounts.cpp @@ -1779,6 +1779,8 @@ UniValue getburninfo(const JSONRPCRequest& request) { UniValue dfipaybacktokens{UniValue::VARR}; + LOCK(cs_main); + auto calcBurn = [&](AccountHistoryKey const & key, CLazySerialize valueLazy) -> bool { const auto & value = valueLazy.get(); @@ -1822,7 +1824,11 @@ UniValue getburninfo(const JSONRPCRequest& request) { if (value.category == uint8_t(CustomTxType::PoolSwap) || value.category == uint8_t(CustomTxType::PoolSwapV2)) { for (auto const & diff : value.diff) { - dexfeeburn.Add({diff.first, diff.second}); + if (pcustomcsview->GetLoanTokenByID(diff.first)) { + dexfeeburn.Add({diff.first, diff.second}); + } else { + burntTokens.Add({diff.first, diff.second}); + } } return true; } @@ -1848,8 +1854,6 @@ UniValue getburninfo(const JSONRPCRequest& request) { result.pushKV("paybackburn", ValueFromAmount(paybackFee)); result.pushKV("dexfeetokens", AmountsToJSON(dexfeeburn.balances)); - LOCK(cs_main); - if (auto attributes = pcustomcsview->GetAttributes()) { CDataStructureV0 liveKey{AttributeTypes::Live, ParamIDs::Economy, EconomyKeys::PaybackDFITokens}; auto tokenBalances = attributes->GetValue(liveKey, CBalances{});