From 28c6a0db9b73fb782db4eb8d6d5187efbc40d57c Mon Sep 17 00:00:00 2001 From: sowle Date: Thu, 24 Nov 2022 04:33:52 +0100 Subject: [PATCH] error logging verbosity improved in a few places --- src/currency_core/blockchain_storage.cpp | 8 ++++---- tests/core_tests/chaingen.cpp | 9 ++++++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/currency_core/blockchain_storage.cpp b/src/currency_core/blockchain_storage.cpp index f45dcfd2..10cbf547 100644 --- a/src/currency_core/blockchain_storage.cpp +++ b/src/currency_core/blockchain_storage.cpp @@ -2508,10 +2508,10 @@ bool blockchain_storage::add_out_to_get_random_outs(COMMAND_RPC_GET_RANDOM_OUTPU CRITICAL_REGION_LOCAL(m_read_lock); auto out_ptr = m_db_outputs.get_subitem(amount, g_index); auto tx_ptr = m_db_transactions.find(out_ptr->tx_id); - CHECK_AND_ASSERT_MES(tx_ptr, false, "internal error: transaction with id " << out_ptr->tx_id << ENDL << - ", used in mounts global index for amount=" << amount << ": g_index=" << g_index << "not found in transactions index"); + CHECK_AND_ASSERT_MES(tx_ptr, false, "internal error: transaction " << out_ptr->tx_id << " was not found in transaction DB, amount: " << print_money_brief(amount) << + ", g_index: " << g_index); CHECK_AND_ASSERT_MES(tx_ptr->tx.vout.size() > out_ptr->out_no, false, "internal error: in global outs index, transaction out index=" - << out_ptr->out_no << " more than transaction outputs = " << tx_ptr->tx.vout.size() << ", for tx id = " << out_ptr->tx_id); + << out_ptr->out_no << " is greater than transaction outputs = " << tx_ptr->tx.vout.size() << ", for tx id = " << out_ptr->tx_id); CHECK_AND_ASSERT_MES(amount != 0 || height_upper_limit != 0, false, "height_upper_limit must be nonzero for hidden amounts (amount = 0)"); @@ -2587,7 +2587,7 @@ size_t blockchain_storage::find_end_of_allowed_index(uint64_t amount) const --i; auto out_ptr = m_db_outputs.get_subitem(amount, i); auto tx_ptr = m_db_transactions.find(out_ptr->tx_id); - CHECK_AND_ASSERT_MES(tx_ptr, 0, "internal error: failed to find transaction from outputs index with tx_id=" << out_ptr->tx_id); + CHECK_AND_ASSERT_MES(tx_ptr, 0, "internal error: failed to find transaction from outputs index with tx_id=" << out_ptr->tx_id << ", amount: " << print_money_brief(amount)); if (tx_ptr->m_keeper_block_height + CURRENCY_MINED_MONEY_UNLOCK_WINDOW <= get_current_blockchain_size()) return i+1; } while (i != 0); diff --git a/tests/core_tests/chaingen.cpp b/tests/core_tests/chaingen.cpp index 18d33a06..2196792f 100644 --- a/tests/core_tests/chaingen.cpp +++ b/tests/core_tests/chaingen.cpp @@ -640,7 +640,14 @@ bool test_generator::find_kernel(const std::list& accs, iterations_processed_total += context.iterations_processed; } - LOG_PRINT_RED("PoS mining iteration failed, kernel was not found. Iterations processed across " << wallets.size() << " wallet(s): " << iterations_processed_total, LOG_LEVEL_0); + LOG_PRINT_RED("PoS mining iteration failed, kernel was not found. Iterations processed across " << wallets.size() << " wallet(s): " << iterations_processed_total << ENDL << + "Stake wallet(s) transfers:", LOG_LEVEL_0); + + for (size_t wallet_index = 0, size = wallets.size(); wallet_index < size; ++wallet_index) + { + std::shared_ptr w = wallets[wallet_index].wallet; + LOG_PRINT_L0("wallet #" << wallet_index << " @ block " << w->get_top_block_height() << ENDL << wallets[wallet_index].wallet->dump_trunsfers()); + } return false; }