wallet api/device: set estimated restore height if none is provided

This commit is contained in:
selsta 2019-01-02 01:08:46 +01:00
parent e344d93ce7
commit 13785ec96b
No known key found for this signature in database
GPG key ID: 2EA0A99A8B07AE5E
4 changed files with 15 additions and 0 deletions

View file

@ -127,6 +127,8 @@ Wallet *WalletManagerImpl::createWalletFromDevice(const std::string &path,
WalletImpl * wallet = new WalletImpl(nettype, kdf_rounds);
if(restoreHeight > 0){
wallet->setRefreshFromBlockHeight(restoreHeight);
} else {
wallet->setRefreshFromBlockHeight(wallet->estimateBlockChainHeight());
}
auto lookahead = tools::parse_subaddress_lookahead(subaddressLookahead);
if (lookahead)