From 6514f0ed7b20eaae5869bf4e14a0d77e093ddba6 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Mon, 19 Feb 2018 10:31:26 +0000 Subject: [PATCH] db_lmdb: fix return code mixup in for_all_* --- src/blockchain_db/lmdb/db_lmdb.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/blockchain_db/lmdb/db_lmdb.cpp b/src/blockchain_db/lmdb/db_lmdb.cpp index fd8aad31d..bdec846d1 100644 --- a/src/blockchain_db/lmdb/db_lmdb.cpp +++ b/src/blockchain_db/lmdb/db_lmdb.cpp @@ -2440,7 +2440,7 @@ bool BlockchainLMDB::for_all_key_images(std::function f) const @@ -2474,7 +2474,7 @@ bool BlockchainLMDB::for_blocks_range(const uint64_t& h1, const uint64_t& h2, st MDB_val k; MDB_val v; - bool ret = true; + bool fret = true; MDB_cursor_op op; if (h1) @@ -2503,7 +2503,7 @@ bool BlockchainLMDB::for_blocks_range(const uint64_t& h1, const uint64_t& h2, st if (!get_block_hash(b, hash)) throw0(DB_ERROR("Failed to get block hash from blob retrieved from the db")); if (!f(height, hash, b)) { - ret = false; + fret = false; break; } if (height >= h2) @@ -2512,7 +2512,7 @@ bool BlockchainLMDB::for_blocks_range(const uint64_t& h1, const uint64_t& h2, st TXN_POSTFIX_RDONLY(); - return ret; + return fret; } bool BlockchainLMDB::for_all_transactions(std::function f) const @@ -2526,7 +2526,7 @@ bool BlockchainLMDB::for_all_transactions(std::function f) const @@ -2573,7 +2573,7 @@ bool BlockchainLMDB::for_all_outputs(std::functionoutput_id); if (!f(amount, toi.first, toi.second)) { - ret = false; + fret = false; break; } } TXN_POSTFIX_RDONLY(); - return ret; + return fret; } // batch_num_blocks: (optional) Used to check if resize needed before batch transaction starts.