From 37724217950cf8f48d97104e14a8016c631a89b6 Mon Sep 17 00:00:00 2001 From: Prasanna Loganathar Date: Thu, 7 Apr 2022 13:49:08 +0530 Subject: [PATCH] Revert "Fix dex loan token burns (#1100)" (#1193) This reverts commit 612bc1a52f7ab9239767f52d0ac5bd5928979e35. --- src/masternodes/rpc_accounts.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/masternodes/rpc_accounts.cpp b/src/masternodes/rpc_accounts.cpp index 598d73e1c3..f202a70f16 100644 --- a/src/masternodes/rpc_accounts.cpp +++ b/src/masternodes/rpc_accounts.cpp @@ -1779,8 +1779,6 @@ 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(); @@ -1824,11 +1822,7 @@ UniValue getburninfo(const JSONRPCRequest& request) { if (value.category == uint8_t(CustomTxType::PoolSwap) || value.category == uint8_t(CustomTxType::PoolSwapV2)) { for (auto const & diff : value.diff) { - if (pcustomcsview->GetLoanTokenByID(diff.first)) { - dexfeeburn.Add({diff.first, diff.second}); - } else { - burntTokens.Add({diff.first, diff.second}); - } + dexfeeburn.Add({diff.first, diff.second}); } return true; } @@ -1854,6 +1848,8 @@ 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{});