From 62fb2cc2f6d768b93685ddcdb88d05047b1624fc Mon Sep 17 00:00:00 2001 From: Rosen Krumov Date: Fri, 7 Jul 2023 01:24:47 +0300 Subject: [PATCH] remove redundant lydra ui logic --- src/locktrip/lydra.cpp | 3 --- src/qt/overviewpage.cpp | 15 --------------- src/qt/overviewpage.h | 2 +- 3 files changed, 1 insertion(+), 19 deletions(-) diff --git a/src/locktrip/lydra.cpp b/src/locktrip/lydra.cpp index d50f2d03c..515ebb1cd 100644 --- a/src/locktrip/lydra.cpp +++ b/src/locktrip/lydra.cpp @@ -35,15 +35,12 @@ std::tuple getAllLydraLockedCache() if (pkhSender) { uint64_t amount; l.getLockedHydraAmountPerAddress(pkhSender->GetReverseHex(), amount); - std::cout << pkhSender->GetReverseHex() << " -> " << amount << std::endl; sum += amount; successful = true; } } } - std::cout << "sum -> " << sum << std::endl; - return std::make_tuple(sum, successful); } diff --git a/src/qt/overviewpage.cpp b/src/qt/overviewpage.cpp index c5f559a8b..551ce78a0 100644 --- a/src/qt/overviewpage.cpp +++ b/src/qt/overviewpage.cpp @@ -288,17 +288,6 @@ OverviewPage::~OverviewPage() delete ui; } -void OverviewPage::setLydraLockedBalance() -{ - auto lydraLockedCache = getAllLydraLockedCache(); - while (!std::get<1>(lydraLockedCache)) lydraLockedCache = getAllLydraLockedCache(); - auto allLydraLockedCache = std::get<0>(lydraLockedCache); - std::cout << "IN UI -> " << allLydraLockedCache << std::endl; - int unit = walletModel->getOptionsModel()->getDisplayUnit(); - ui->labelBalance->setText(BitcoinUnits::formatWithUnit(unit, m_balances.balance - allLydraLockedCache, false, BitcoinUnits::separatorAlways)); - ui->labelLydraLocked->setText(BitcoinUnits::formatWithUnit(unit, allLydraLockedCache, false, BitcoinUnits::separatorAlways)); -} - void OverviewPage::setBalance(const interfaces::WalletBalances& balances) { int unit = walletModel->getOptionsModel()->getDisplayUnit(); @@ -425,10 +414,6 @@ void OverviewPage::setWalletModel(WalletModel *model) // check for presence of invalid tokens QTimer::singleShot(500, this, SLOT(checkForInvalidTokens())); - - // QTimer *lydraCacheTimer = new QTimer(this); - // connect(lydraCacheTimer, &QTimer::timeout, this, [=]() {setLydraLockedBalance();}); - // lydraCacheTimer->start(1000); } void OverviewPage::updateDisplayUnit() diff --git a/src/qt/overviewpage.h b/src/qt/overviewpage.h index e28efc85f..4ab045b65 100644 --- a/src/qt/overviewpage.h +++ b/src/qt/overviewpage.h @@ -37,7 +37,7 @@ class OverviewPage : public QWidget void setClientModel(ClientModel *clientModel); void setWalletModel(WalletModel *walletModel); void showOutOfSyncWarning(bool fShow); - void setLydraLockedBalance(); + public Q_SLOTS: void setBalance(const interfaces::WalletBalances& balances); void checkForInvalidTokens();