wallet2: lower default for subaddress lookahead when restoring with hardware

This commit is contained in:
stoffu 2018-06-04 19:18:18 +09:00 committed by moneromooo-monero
parent ed366efb8c
commit fbdc30966b
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3

View file

@ -3260,6 +3260,12 @@ void wallet2::restore(const std::string& wallet_, const epee::wipeable_string& p
cryptonote::block b; cryptonote::block b;
generate_genesis(b); generate_genesis(b);
m_blockchain.push_back(get_block_hash(b)); m_blockchain.push_back(get_block_hash(b));
if (m_subaddress_lookahead_major == SUBADDRESS_LOOKAHEAD_MAJOR && m_subaddress_lookahead_minor == SUBADDRESS_LOOKAHEAD_MINOR)
{
// the default lookahead setting (50:200) is clearly too much for hardware wallet
m_subaddress_lookahead_major = 5;
m_subaddress_lookahead_minor = 20;
}
add_subaddress_account(tr("Primary account")); add_subaddress_account(tr("Primary account"));
if (!wallet_.empty()) { if (!wallet_.empty()) {
store(); store();