1
0
Fork 0
forked from lthn/blockchain

clarify logging

This commit is contained in:
sowle 2023-08-06 01:23:52 +02:00
parent df087b40c3
commit 02138c86a4
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC
2 changed files with 6 additions and 3 deletions

View file

@ -4642,7 +4642,8 @@ struct outputs_visitor
{
if (!m_bch.is_tx_spendtime_unlocked(source_out_unlock_time))
{
LOG_PRINT_L0("One of outputs for one of inputs have wrong tx.unlock_time = " << get_tx_unlock_time(source_tx, out_i));
uint64_t limit = source_out_unlock_time < CURRENCY_MAX_BLOCK_NUMBER ? m_bch.get_current_blockchain_size() - 1 + CURRENCY_LOCKED_TX_ALLOWED_DELTA_BLOCKS : m_bch.get_core_runtime_config().get_core_time() + CURRENCY_LOCKED_TX_ALLOWED_DELTA_SECONDS;
LOG_PRINT_L0("An output has unlock time value of " << get_tx_unlock_time(source_tx, out_i) << " while the current limit is " << limit);
return false;
}
}

View file

@ -828,7 +828,8 @@ namespace currency
if (!vis.handle_output(tx_ptr->tx, validated_tx, o, n))
{
LOG_PRINT_RED_L0("handle_output failed for output #" << n << " in " << tx_id);
size_t verified_input_index = std::find(validated_tx.vin.begin(), validated_tx.vin.end(), verified_input) - validated_tx.vin.begin();
LOG_PRINT_RED_L0("handle_output failed for output #" << n << " in " << tx_id << " referenced by input #" << verified_input_index << " in tx " << get_transaction_hash(validated_tx));
return false;
}
TIME_MEASURE_FINISH_PD(tx_check_inputs_loop_scan_outputkeys_loop_handle_output);
@ -843,7 +844,8 @@ namespace currency
TIME_MEASURE_START_PD(tx_check_inputs_loop_scan_outputkeys_loop_handle_output);
if (!vis.handle_output(tx_ptr->tx, validated_tx, out_zc, n))
{
LOG_PRINT_RED_L0("handle_output failed for output #" << n << " in " << tx_id);
size_t verified_input_index = std::find(validated_tx.vin.begin(), validated_tx.vin.end(), verified_input) - validated_tx.vin.begin();
LOG_PRINT_RED_L0("handle_output failed for output #" << n << " in " << tx_id << " referenced by input #" << verified_input_index << " in tx " << get_transaction_hash(validated_tx));
return false;
}
TIME_MEASURE_FINISH_PD(tx_check_inputs_loop_scan_outputkeys_loop_handle_output);