Merge pull request #1629

c02e1cb9 Updates to epee HTTP client code   - http_simple_client now uses std::chrono for timeouts   - http_simple_client accepts timeouts per connect / invoke call   - shortened names of epee http invoke functions   - invoke command functions only take relative path, connection     is not automatically performed (Lee Clagett)
This commit is contained in:
Riccardo Spagni 2017-02-02 19:32:01 +02:00
commit 5fb3f97a55
No known key found for this signature in database
GPG key ID: 55432DF31CCD4FCD
15 changed files with 172 additions and 323 deletions

View file

@ -646,12 +646,12 @@ string WalletImpl::keysFilename() const
bool WalletImpl::init(const std::string &daemon_address, uint64_t upper_transaction_size_limit)
{
clearStatus();
doInit(daemon_address, upper_transaction_size_limit);
if (!doInit(daemon_address, upper_transaction_size_limit))
return false;
bool result = this->refresh();
// enabling background refresh thread
startRefresh();
return result;
}
void WalletImpl::initAsync(const string &daemon_address, uint64_t upper_transaction_size_limit)
@ -1362,9 +1362,10 @@ bool WalletImpl::isNewWallet() const
return !(blockChainHeight() > 1 || m_recoveringFromSeed || m_rebuildWalletCache) && !watchOnly();
}
void WalletImpl::doInit(const string &daemon_address, uint64_t upper_transaction_size_limit)
bool WalletImpl::doInit(const string &daemon_address, uint64_t upper_transaction_size_limit)
{
m_wallet->init(daemon_address, upper_transaction_size_limit);
if (!m_wallet->init(daemon_address, upper_transaction_size_limit))
return false;
// in case new wallet, this will force fast-refresh (pulling hashes instead of blocks)
// If daemon isn't synced a calculated block height will be used instead
@ -1383,8 +1384,7 @@ void WalletImpl::doInit(const string &daemon_address, uint64_t upper_transaction
this->setTrustedDaemon(false);
m_refreshIntervalMillis = DEFAULT_REMOTE_NODE_REFRESH_INTERVAL_MILLIS;
}
return true;
}
bool WalletImpl::parse_uri(const std::string &uri, std::string &address, std::string &payment_id, uint64_t &amount, std::string &tx_description, std::string &recipient_name, std::vector<std::string> &unknown_parameters, std::string &error)