1
0
Fork 0
forked from lthn/blockchain

error logging verbosity improved in a few places

This commit is contained in:
sowle 2022-11-24 04:33:52 +01:00
parent 834ad93094
commit 28c6a0db9b
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC
2 changed files with 12 additions and 5 deletions

View file

@ -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);

View file

@ -640,7 +640,14 @@ bool test_generator::find_kernel(const std::list<currency::account_base>& 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<tools::wallet2> 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;
}