Skip to content

Commit

Permalink
remove redundant lydra ui logic
Browse files Browse the repository at this point in the history
  • Loading branch information
RosenKrumov committed Jul 6, 2023
1 parent 888b78a commit 62fb2cc
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 19 deletions.
3 changes: 0 additions & 3 deletions src/locktrip/lydra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,12 @@ std::tuple<uint64_t, bool> 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);
}

Expand Down
15 changes: 0 additions & 15 deletions src/qt/overviewpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion src/qt/overviewpage.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 62fb2cc

Please sign in to comment.