Skip to content

Commit

Permalink
Merge pull request #2656
Browse files Browse the repository at this point in the history
3492de0 fix lightwallet and subaddresses conflict (Jaquee)
329f149 remove reference to cryptonote::null_hash (Jaquee)
  • Loading branch information
fluffypony committed Oct 15, 2017
2 parents b293ad9 + 3492de0 commit 97c11ca
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/cryptonote_core/blockchain.cpp
Expand Up @@ -3244,7 +3244,7 @@ bool Blockchain::handle_block_to_main_chain(const block& bl, const crypto::hash&
{
auto hash = get_block_hash(bl);
const auto &expected_hash = m_blocks_hash_check[m_db->height()];
if (expected_hash != cryptonote::null_hash)
if (expected_hash != crypto::null_hash)
{
if (memcmp(&hash, &expected_hash, sizeof(hash)) != 0)
{
Expand Down Expand Up @@ -3807,7 +3807,7 @@ uint64_t Blockchain::prevalidate_block_hashes(uint64_t height, const std::list<c
size_t end = n * HASH_OF_HASHES_STEP + HASH_OF_HASHES_STEP;
for (size_t i = n * HASH_OF_HASHES_STEP; i < end; ++i)
{
CHECK_AND_ASSERT_MES(m_blocks_hash_check[i] == cryptonote::null_hash || m_blocks_hash_check[i] == data[i - first_index * HASH_OF_HASHES_STEP],
CHECK_AND_ASSERT_MES(m_blocks_hash_check[i] == crypto::null_hash || m_blocks_hash_check[i] == data[i - first_index * HASH_OF_HASHES_STEP],
0, "Consistency failure in m_blocks_hash_check construction");
m_blocks_hash_check[i] = data[i - first_index * HASH_OF_HASHES_STEP];
}
Expand Down Expand Up @@ -4345,7 +4345,7 @@ void Blockchain::load_compiled_in_block_hashes()
p += sizeof(hash.data);
m_blocks_hash_of_hashes.push_back(hash);
}
m_blocks_hash_check.resize(m_blocks_hash_of_hashes.size() * HASH_OF_HASHES_STEP, cryptonote::null_hash);
m_blocks_hash_check.resize(m_blocks_hash_of_hashes.size() * HASH_OF_HASHES_STEP, crypto::null_hash);
MINFO(nblocks << " block hashes loaded");

// FIXME: clear tx_pool because the process might have been
Expand Down
7 changes: 6 additions & 1 deletion src/wallet/wallet2.cpp
Expand Up @@ -5324,7 +5324,12 @@ bool wallet2::light_wallet_key_image_is_ours(const crypto::key_image& key_image,
// Not in cache - calculate key image
crypto::key_image calculated_key_image;
cryptonote::keypair in_ephemeral;
cryptonote::generate_key_image_helper(get_account().get_keys(), tx_public_key, out_index, in_ephemeral, calculated_key_image);

// Subaddresses aren't supported in mymonero/openmonero yet. Using empty values.
const std::vector<crypto::public_key> additional_tx_pub_keys;
const crypto::public_key pkey = crypto::null_pkey;

cryptonote::generate_key_image_helper(get_account().get_keys(), m_subaddresses, pkey, tx_public_key, additional_tx_pub_keys, out_index, in_ephemeral, calculated_key_image);
index_keyimage_map.emplace(out_index, calculated_key_image);
m_key_image_cache.emplace(tx_public_key, index_keyimage_map);
return key_image == calculated_key_image;
Expand Down

0 comments on commit 97c11ca

Please sign in to comment.