wallet2: fix missing subaddress indices in "light" exported outputs

This commit is contained in:
moneromooo-monero 2022-08-07 14:56:59 +00:00
parent 57e57c239b
commit 0de1571abd
No known key found for this signature in database
GPG Key ID: 686F07454D6CEFC3
2 changed files with 8 additions and 2 deletions

View File

@ -13241,7 +13241,7 @@ size_t wallet2::import_outputs(const std::pair<uint64_t, std::vector<tools::wall
exported_transfer_details etd = outputs.second[i];
transfer_details &td = m_transfers[i + offset];
// setup td with "cheao" loaded data
// setup td with "cheap" loaded data
td.m_block_height = 0;
td.m_txid = crypto::null_hash;
td.m_global_output_index = etd.m_global_output_index;
@ -13254,6 +13254,8 @@ size_t wallet2::import_outputs(const std::pair<uint64_t, std::vector<tools::wall
td.m_key_image_known = etd.m_flags.m_key_image_known;
td.m_key_image_request = etd.m_flags.m_key_image_request;
td.m_key_image_partial = false;
td.m_subaddr_index.major = etd.m_subaddr_index_major;
td.m_subaddr_index.minor = etd.m_subaddr_index_minor;
// skip those we've already imported, or which have different data
if (i + offset < original_size)

View File

@ -401,9 +401,11 @@ private:
} m_flags;
uint64_t m_amount;
std::vector<crypto::public_key> m_additional_tx_keys;
uint32_t m_subaddr_index_major;
uint32_t m_subaddr_index_minor;
BEGIN_SERIALIZE_OBJECT()
VERSION_FIELD(0)
VERSION_FIELD(1)
FIELD(m_pubkey)
VARINT_FIELD(m_internal_output_index)
VARINT_FIELD(m_global_output_index)
@ -411,6 +413,8 @@ private:
FIELD(m_flags.flags)
VARINT_FIELD(m_amount)
FIELD(m_additional_tx_keys)
VARINT_FIELD(m_subaddr_index_major)
VARINT_FIELD(m_subaddr_index_minor)
END_SERIALIZE()
};