diff options
author | Riccardo Spagni <ric@spagni.net> | 2015-10-27 09:03:05 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2015-10-27 09:03:07 +0200 |
commit | 9292c1e7cddbc65789d1a78a7db99111ce1980f2 (patch) | |
tree | 4206eac96b7430bd4d712cf6cf796ebaae5bbc83 /src/cryptonote_core | |
parent | Merge pull request #451 (diff) | |
parent | Build fixes for the old blockchain_storage version (diff) | |
download | monero-9292c1e7cddbc65789d1a78a7db99111ce1980f2.tar.xz |
Merge pull request #453
3e89df4 Build fixes for the old blockchain_storage version (moneromooo-monero)
Diffstat (limited to 'src/cryptonote_core')
-rw-r--r-- | src/cryptonote_core/blockchain_storage.cpp | 10 | ||||
-rw-r--r-- | src/cryptonote_core/blockchain_storage.h | 4 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/cryptonote_core/blockchain_storage.cpp b/src/cryptonote_core/blockchain_storage.cpp index 6d2b33bda..fa63efe0b 100644 --- a/src/cryptonote_core/blockchain_storage.cpp +++ b/src/cryptonote_core/blockchain_storage.cpp @@ -1900,19 +1900,21 @@ bool blockchain_storage::for_all_key_images(std::function<bool(const crypto::key return true; } //------------------------------------------------------------------ -bool blockchain_storage::for_all_blocks(std::function<bool(uint64_t, const block&)> f) const +bool blockchain_storage::for_all_blocks(std::function<bool(uint64_t, const crypto::hash&, const block&)> f) const { for (blocks_container::const_iterator i = m_blocks.begin(); i != m_blocks.end(); ++i) { - if (!f(i->height, i->bl)) + crypto::hash hash; + get_block_hash (i->bl, hash); + if (!f(i->height, hash, i->bl)) return false; } return true; } //------------------------------------------------------------------ -bool blockchain_storage::for_all_transactions(std::function<bool(const transaction&)> f) const +bool blockchain_storage::for_all_transactions(std::function<bool(const crypto::hash&, const transaction&)> f) const { for (transactions_container::const_iterator i = m_transactions.begin(); i != m_transactions.end(); ++i) { - if (!f(i->second.tx)) + if (!f(i->first, i->second.tx)) return false; } return true; diff --git a/src/cryptonote_core/blockchain_storage.h b/src/cryptonote_core/blockchain_storage.h index 4a4fc14c2..671cdadc4 100644 --- a/src/cryptonote_core/blockchain_storage.h +++ b/src/cryptonote_core/blockchain_storage.h @@ -186,8 +186,8 @@ namespace cryptonote uint64_t get_block_coins_generated(uint64_t height) const { return m_blocks[height].already_generated_coins; } bool for_all_key_images(std::function<bool(const crypto::key_image&)>) const; - bool for_all_blocks(std::function<bool(uint64_t height, const block&)>) const; - bool for_all_transactions(std::function<bool(const transaction&)>) const; + bool for_all_blocks(std::function<bool(uint64_t height, const crypto::hash&, const block&)>) const; + bool for_all_transactions(std::function<bool(const crypto::hash&, const transaction&)>) const; bool for_all_outputs(std::function<bool(uint64_t amount, const crypto::hash &tx_hash, size_t tx_idx)>) const; // use for testing only |