From d17c0fc2d0ae52260a93ec8985b7ebb7ad3cfea7 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Thu, 1 Jun 2017 13:29:51 +0100 Subject: 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. --- src/cryptonote_core/blockchain.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/cryptonote_core/blockchain.h') diff --git a/src/cryptonote_core/blockchain.h b/src/cryptonote_core/blockchain.h index 89efe5452..52172012c 100644 --- a/src/cryptonote_core/blockchain.h +++ b/src/cryptonote_core/blockchain.h @@ -790,13 +790,15 @@ namespace cryptonote bool for_all_key_images(std::function) const; /** - * @brief perform a check on all blocks in the blockchain + * @brief perform a check on all blocks in the blockchain in the given range * + * @param h1 the start height + * @param h2 the end height * @param std::function the check to perform, pass/fail * * @return false if any block fails the check, otherwise true */ - bool for_all_blocks(std::function) const; + bool for_blocks_range(const uint64_t& h1, const uint64_t& h2, std::function) const; /** * @brief perform a check on all transactions in the blockchain -- cgit v1.2.3