Wallet api: Update trustedDaemon when daemon is changed

This commit is contained in:
Jaquee 2017-01-08 13:47:13 +01:00
parent dbb838f4d0
commit 0d3918e15b
No known key found for this signature in database
GPG Key ID: 384E52B09F45DC39
1 changed files with 6 additions and 0 deletions

View File

@ -52,6 +52,8 @@ namespace {
static const int DEFAULT_REFRESH_INTERVAL_MILLIS = 1000 * 10; static const int DEFAULT_REFRESH_INTERVAL_MILLIS = 1000 * 10;
// limit maximum refresh interval as one minute // limit maximum refresh interval as one minute
static const int MAX_REFRESH_INTERVAL_MILLIS = 1000 * 60 * 1; static const int MAX_REFRESH_INTERVAL_MILLIS = 1000 * 60 * 1;
// Default refresh interval when connected to remote node
static const int DEFAULT_REMOTE_NODE_REFRESH_INTERVAL_MILLIS = 1000 * 10;
} }
struct Wallet2CallbackImpl : public tools::i_wallet2_callback struct Wallet2CallbackImpl : public tools::i_wallet2_callback
@ -1186,6 +1188,10 @@ void WalletImpl::doInit(const string &daemon_address, uint64_t upper_transaction
if (Utils::isAddressLocal(daemon_address)) { if (Utils::isAddressLocal(daemon_address)) {
this->setTrustedDaemon(true); this->setTrustedDaemon(true);
m_refreshIntervalMillis = DEFAULT_REFRESH_INTERVAL_MILLIS;
} else {
this->setTrustedDaemon(false);
m_refreshIntervalMillis = DEFAULT_REMOTE_NODE_REFRESH_INTERVAL_MILLIS;
} }