Wallet: add m_initialized

This commit is contained in:
Jaquee 2016-11-26 17:01:59 +01:00
parent c7232e1fe6
commit 0e8cd146db
No known key found for this signature in database
GPG key ID: 384E52B09F45DC39
2 changed files with 4 additions and 4 deletions

View file

@ -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()

View file

@ -222,6 +222,7 @@ private:
ConnectionStatus m_connectionStatus;
int m_connectionStatusTtl;
mutable QTime m_connectionStatusTime;
bool m_initialized;
};