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