1
0
Fork 0
forked from lthn/blockchain

added more debug info in error reporting

This commit is contained in:
crypro.zoidberg 2019-01-17 21:57:40 +03:00
parent 8a340a4359
commit d5dec1805b
2 changed files with 5 additions and 3 deletions

View file

@ -4306,7 +4306,8 @@ bool blockchain_storage::handle_block_to_main_chain(const block& bl, const crypt
if (!check_hash(proof_hash, current_diffic))
{
LOG_ERROR("Block with id: " << id << ENDL
<< " : " << proof_hash << ENDL
<< "PoW hash: " << proof_hash << ENDL
<< "PoW seed: " << m_current_scratchpad_seed << ENDL
<< "unexpected difficulty: " << current_diffic);
bvc.m_verification_failed = true;
return false;
@ -5326,6 +5327,7 @@ bool blockchain_storage::validate_alt_block_ms_input(const transaction& input_tx
bool blockchain_storage::get_seed_for_scratchpad(uint64_t height, crypto::hash& seed)const
{
CRITICAL_REGION_LOCAL(m_read_lock);
LOG_PRINT_MAGENTA("Get seed for scratchpad [main_chain] on height " << height, LOG_LEVEL_0);
return get_seed_for_scratchpad_cb(height, seed, [&](uint64_t index) -> crypto::hash
{
return get_block_hash(m_db_blocks[index]->bl);

View file

@ -669,7 +669,7 @@ namespace currency
crypto::hash genesis_seed = null_hash;
bool r = epee::string_tools::hex_to_pod(CURRENCY_SCRATCHPAD_GENESIS_SEED, genesis_seed);
CHECK_AND_ASSERT_THROW_MES(r, "Unable to parse CURRENCY_SCRATCHPAD_GENESIS_SEED " << CURRENCY_SCRATCHPAD_GENESIS_SEED);
LOG_PRINT_MAGENTA("[SCRATCHPAD] GENESIS SEED SELECTED: " << genesis_seed, LOG_LEVEL_1);
LOG_PRINT_MAGENTA("[SCRATCHPAD] GENESIS SEED SELECTED: " << genesis_seed, LOG_LEVEL_0);
seed = genesis_seed;
return true;
}
@ -688,7 +688,7 @@ namespace currency
}
seed = crypto::cn_fast_hash(&seed_data[0], sizeof(seed_data[0]) * seed_data.size());
LOG_PRINT_MAGENTA("[SCRATCHPAD] SEED SELECTED: h = " << last_upd_h << ", selector: " << selector_id << ENDL << ss.str() << "SEED: " << seed, LOG_LEVEL_1);
LOG_PRINT_MAGENTA("[SCRATCHPAD] SEED SELECTED: h = " << last_upd_h << ", selector: " << selector_id << ENDL << ss.str() << "SEED: " << seed, LOG_LEVEL_0);
return true;
}