Don't copy blockchain for coinbase_tx_sum

Changed Blockchain::for_all_blocks() to for_blocks_range()
Operate on blockchain in-place instead of building a copy first.
This commit is contained in:
Howard Chu 2017-06-01 13:29:51 +01:00
parent 8fbbefb8db
commit d17c0fc2d0
No known key found for this signature in database
GPG key ID: FD2A70B44AB11BA7
7 changed files with 32 additions and 15 deletions

View file

@ -106,7 +106,7 @@ public:
virtual void remove_spent_key(const crypto::key_image& k_image) {}
virtual bool for_all_key_images(std::function<bool(const crypto::key_image&)>) const { return true; }
virtual bool for_all_blocks(std::function<bool(uint64_t, const crypto::hash&, const cryptonote::block&)>) const { return true; }
virtual bool for_blocks_range(const uint64_t&, const uint64_t&, std::function<bool(uint64_t, const crypto::hash&, const cryptonote::block&)>) const { return true; }
virtual bool for_all_transactions(std::function<bool(const crypto::hash&, const cryptonote::transaction&)>) const { return true; }
virtual bool for_all_outputs(std::function<bool(uint64_t amount, const crypto::hash &tx_hash, size_t tx_idx)> f) const { return true; }
virtual bool is_read_only() const { return false; }