mirror of
https://github.com/monero-project/monero-gui.git
synced 2024-12-23 12:09:57 +00:00
Wallet: add m_initialized
This commit is contained in:
parent
c7232e1fe6
commit
0e8cd146db
2 changed files with 4 additions and 4 deletions
|
@ -90,11 +90,9 @@ Wallet::Status Wallet::status() const
|
|||
|
||||
Wallet::ConnectionStatus Wallet::connected()
|
||||
{
|
||||
qDebug("Checking wallet connection status");
|
||||
|
||||
// cache connection status
|
||||
if(m_connectionStatusTime.elapsed() / 1000 > m_connectionStatusTtl){
|
||||
qDebug("connectionStatus query");
|
||||
if(!m_initialized || m_connectionStatusTime.elapsed() / 1000 > m_connectionStatusTtl){
|
||||
m_initialized = true;
|
||||
ConnectionStatus newStatus = static_cast<ConnectionStatus>(m_walletImpl->connected());
|
||||
if(newStatus != m_connectionStatus) {
|
||||
m_connectionStatus = newStatus;
|
||||
|
@ -442,6 +440,7 @@ Wallet::Wallet(Bitmonero::Wallet *w, QObject *parent)
|
|||
m_connectionStatusTime.restart();
|
||||
m_daemonBlockChainHeightTime.restart();
|
||||
m_daemonBlockChainTargetHeightTime.restart();
|
||||
m_initialized = false;
|
||||
}
|
||||
|
||||
Wallet::~Wallet()
|
||||
|
|
|
@ -222,6 +222,7 @@ private:
|
|||
ConnectionStatus m_connectionStatus;
|
||||
int m_connectionStatusTtl;
|
||||
mutable QTime m_connectionStatusTime;
|
||||
bool m_initialized;
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue