|
|
@ -889,32 +889,31 @@ void wallet2::expand_subaddresses(const cryptonote::subaddress_index& index)
|
|
|
|
cryptonote::subaddress_index index2;
|
|
|
|
cryptonote::subaddress_index index2;
|
|
|
|
for (index2.major = m_subaddress_labels.size(); index2.major < index.major + m_subaddress_lookahead_major; ++index2.major)
|
|
|
|
for (index2.major = m_subaddress_labels.size(); index2.major < index.major + m_subaddress_lookahead_major; ++index2.major)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
for (index2.minor = 0; index2.minor < (index2.major == index.major ? index.minor : 0) + m_subaddress_lookahead_minor; ++index2.minor)
|
|
|
|
const uint32_t end = (index2.major == index.major ? index.minor : 0) + m_subaddress_lookahead_minor;
|
|
|
|
|
|
|
|
const std::vector<crypto::public_key> pkeys = cryptonote::get_subaddress_spend_public_keys(m_account.get_keys(), index2.major, 0, end);
|
|
|
|
|
|
|
|
for (index2.minor = 0; index2.minor < end; ++index2.minor)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (m_subaddresses_inv.count(index2) == 0)
|
|
|
|
const crypto::public_key &D = pkeys[index2.minor];
|
|
|
|
{
|
|
|
|
|
|
|
|
crypto::public_key D = get_subaddress_spend_public_key(index2);
|
|
|
|
|
|
|
|
m_subaddresses[D] = index2;
|
|
|
|
m_subaddresses[D] = index2;
|
|
|
|
m_subaddresses_inv[index2] = D;
|
|
|
|
m_subaddresses_inv[index2] = D;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
m_subaddress_labels.resize(index.major + 1, {"Untitled account"});
|
|
|
|
m_subaddress_labels.resize(index.major + 1, {"Untitled account"});
|
|
|
|
m_subaddress_labels[index.major].resize(index.minor + 1);
|
|
|
|
m_subaddress_labels[index.major].resize(index.minor + 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (m_subaddress_labels[index.major].size() <= index.minor)
|
|
|
|
else if (m_subaddress_labels[index.major].size() <= index.minor)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// add new subaddresses
|
|
|
|
// add new subaddresses
|
|
|
|
cryptonote::subaddress_index index2 = index;
|
|
|
|
const uint32_t end = index.minor + m_subaddress_lookahead_minor;
|
|
|
|
for (index2.minor = m_subaddress_labels[index.major].size(); index2.minor < index.minor + m_subaddress_lookahead_minor; ++index2.minor)
|
|
|
|
const uint32_t begin = m_subaddress_labels[index.major].size();
|
|
|
|
|
|
|
|
cryptonote::subaddress_index index2 = {index.major, begin};
|
|
|
|
|
|
|
|
const std::vector<crypto::public_key> pkeys = cryptonote::get_subaddress_spend_public_keys(m_account.get_keys(), index2.major, index2.minor, end);
|
|
|
|
|
|
|
|
for (; index2.minor < end; ++index2.minor)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (m_subaddresses_inv.count(index2) == 0)
|
|
|
|
const crypto::public_key &D = pkeys[index2.minor - begin];
|
|
|
|
{
|
|
|
|
|
|
|
|
crypto::public_key D = get_subaddress_spend_public_key(index2);
|
|
|
|
|
|
|
|
m_subaddresses[D] = index2;
|
|
|
|
m_subaddresses[D] = index2;
|
|
|
|
m_subaddresses_inv[index2] = D;
|
|
|
|
m_subaddresses_inv[index2] = D;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
m_subaddress_labels[index.major].resize(index.minor + 1);
|
|
|
|
m_subaddress_labels[index.major].resize(index.minor + 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|