mirror of
https://github.com/monero-project/monero.git
synced 2024-11-17 08:17:37 +00:00
GUI: Improved refresh performance
This commit is contained in:
parent
805625b541
commit
0cc50bdd11
1 changed files with 10 additions and 7 deletions
|
@ -85,11 +85,14 @@ struct Wallet2CallbackImpl : public tools::i_wallet2_callback
|
||||||
|
|
||||||
virtual void on_new_block(uint64_t height, const cryptonote::block& block)
|
virtual void on_new_block(uint64_t height, const cryptonote::block& block)
|
||||||
{
|
{
|
||||||
//LOG_PRINT_L3(__FUNCTION__ << ": new block. height: " << height);
|
// Don't flood the GUI with signals. On fast refresh - send signal every 1000th block
|
||||||
|
// get_refresh_from_block_height() returns the blockheight from when the wallet was
|
||||||
if (m_listener) {
|
// created or the restore height specified when wallet was recovered
|
||||||
m_listener->newBlock(height);
|
if(height >= m_wallet->m_wallet->get_refresh_from_block_height() || height % 1000 == 0) {
|
||||||
// m_listener->updated();
|
// LOG_PRINT_L3(__FUNCTION__ << ": new block. height: " << height);
|
||||||
|
if (m_listener) {
|
||||||
|
m_listener->newBlock(height);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -534,7 +537,7 @@ bool WalletImpl::close()
|
||||||
if (status() != Status_Critical)
|
if (status() != Status_Critical)
|
||||||
m_wallet->store();
|
m_wallet->store();
|
||||||
else
|
else
|
||||||
LOG_PRINT_L3("Status_Critical - not storing wallet");
|
LOG_ERROR("Status_Critical - not storing wallet");
|
||||||
LOG_PRINT_L1("wallet::store done");
|
LOG_PRINT_L1("wallet::store done");
|
||||||
LOG_PRINT_L1("Calling wallet::stop...");
|
LOG_PRINT_L1("Calling wallet::stop...");
|
||||||
m_wallet->stop();
|
m_wallet->stop();
|
||||||
|
@ -1310,8 +1313,8 @@ void WalletImpl::doRefresh()
|
||||||
|
|
||||||
void WalletImpl::startRefresh()
|
void WalletImpl::startRefresh()
|
||||||
{
|
{
|
||||||
LOG_PRINT_L2(__FUNCTION__ << ": refresh started/resumed...");
|
|
||||||
if (!m_refreshEnabled) {
|
if (!m_refreshEnabled) {
|
||||||
|
LOG_PRINT_L2(__FUNCTION__ << ": refresh started/resumed...");
|
||||||
m_refreshEnabled = true;
|
m_refreshEnabled = true;
|
||||||
m_refreshCV.notify_one();
|
m_refreshCV.notify_one();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue