From c96f9b0255dc8b62055a693a24bfdc8e1b6e1b90 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Thu, 1 Dec 2016 14:29:35 +0000 Subject: [PATCH] db_lmdb: guard against going out of sync on unexpected db results m_num_outputs keeps track of the number of outputs, which should be the same as the size of both the output_txs and output_amounts databases. If one goes out of sync, we need to throw to abort whatever it is we were doing. --- src/blockchain_db/lmdb/db_lmdb.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/blockchain_db/lmdb/db_lmdb.cpp b/src/blockchain_db/lmdb/db_lmdb.cpp index ea33dc6c9..91a576b4e 100644 --- a/src/blockchain_db/lmdb/db_lmdb.cpp +++ b/src/blockchain_db/lmdb/db_lmdb.cpp @@ -910,7 +910,7 @@ void BlockchainLMDB::remove_output(const uint64_t amount, const uint64_t& out_in result = mdb_cursor_get(m_cur_output_txs, (MDB_val *)&zerokval, &otxk, MDB_GET_BOTH); if (result == MDB_NOTFOUND) { - LOG_PRINT_L0("Unexpected: global output index not found in m_output_txs"); + throw0(DB_ERROR("Unexpected: global output index not found in m_output_txs")); } else if (result) {