forked from lthn/blockchain
minor fixes and impovements
This commit is contained in:
parent
eb7bf075cf
commit
fd0e7c3f7d
4 changed files with 13 additions and 5 deletions
|
|
@ -4861,7 +4861,7 @@ bool blockchain_storage::handle_block_to_main_chain(const block& bl, const crypt
|
|||
CHECK_AND_ASSERT_MES_NO_RET(add_res, "handle_block_to_main_chain: failed to add transaction back to transaction pool");
|
||||
purge_block_data_from_blockchain(bl, tx_processed_count);
|
||||
add_block_as_invalid(bl, id);
|
||||
LOG_PRINT_L0("Block with id " << id << " added as invalid becouse of wrong inputs in transactions");
|
||||
LOG_PRINT_L0("Block with id " << id << " added as invalid because of wrong inputs in transactions");
|
||||
bvc.m_verification_failed = true;
|
||||
return false;
|
||||
}
|
||||
|
|
@ -5361,7 +5361,7 @@ bool blockchain_storage::build_stake_modifier(stake_modifier_type& sm, const alt
|
|||
else
|
||||
{
|
||||
bool r = string_tools::parse_tpod_from_hex_string(POS_STARTER_KERNEL_HASH, sm.last_pos_kernel_id);
|
||||
CHECK_AND_ASSERT_MES(r, false, "Failed to parse POS_STARTER_MODFIFIER");
|
||||
CHECK_AND_ASSERT_MES(r, false, "Failed to parse POS_STARTER_KERNEL_HASH");
|
||||
}
|
||||
|
||||
sm.last_pow_id = get_block_hash(pbei_last_pow->bl);
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ bool test_generator::add_block_info(const currency::block& b, const std::list<cu
|
|||
sk.stake_modifier.last_pos_kernel_id = chain[pos_idx]->ks_hash;
|
||||
else
|
||||
{
|
||||
CHECK_AND_ASSERT_MES(string_tools::parse_tpod_from_hex_string(POS_STARTER_KERNEL_HASH, sk.stake_modifier.last_pos_kernel_id), false, "Failed to parse POS_STARTER_MODFIFIER");
|
||||
CHECK_AND_ASSERT_MES(string_tools::parse_tpod_from_hex_string(POS_STARTER_KERNEL_HASH, sk.stake_modifier.last_pos_kernel_id), false, "Failed to parse POS_STARTER_KERNEL_HASH");
|
||||
}
|
||||
uint64_t pow_idx = get_last_block_of_type(false, chain);
|
||||
sk.stake_modifier.last_pow_id = get_block_hash(chain[pow_idx]->b);
|
||||
|
|
@ -686,7 +686,7 @@ bool test_generator::build_stake_modifier(stake_modifier_type& sm, const test_ge
|
|||
else
|
||||
{
|
||||
bool r = string_tools::parse_tpod_from_hex_string(POS_STARTER_KERNEL_HASH, sm.last_pos_kernel_id);
|
||||
CHECK_AND_ASSERT_MES(r, false, "Failed to parse POS_STARTER_MODFIFIER");
|
||||
CHECK_AND_ASSERT_MES(r, false, "Failed to parse POS_STARTER_KERNEL_HASH");
|
||||
}
|
||||
|
||||
sm.last_pow_id = get_block_hash(blck_chain[last_pow_i]->b);
|
||||
|
|
|
|||
|
|
@ -1024,3 +1024,11 @@ void tx2log(const currency::transaction& tx)
|
|||
currency::transaction ltx = tx;
|
||||
LOG_PRINT("!dbg transaction: " << currency::get_transaction_hash(ltx) << ENDL << currency::obj_to_json_str(ltx), LOG_LEVEL_0);
|
||||
}
|
||||
|
||||
const char* amount2log(const uint64_t amount)
|
||||
{
|
||||
static std::string s;
|
||||
s = currency::print_money_brief(amount);
|
||||
LOG_PRINT("!dbg amount: " << s, LOG_LEVEL_0);
|
||||
return s.c_str();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ void pos_block_builder::step3_build_stake_kernel(
|
|||
if (last_pos_block_kernel_hash == null_hash)
|
||||
{
|
||||
bool r = string_tools::parse_tpod_from_hex_string(POS_STARTER_KERNEL_HASH, m_stake_kernel.stake_modifier.last_pos_kernel_id);
|
||||
CHECK_AND_ASSERT_THROW_MES(r, "Failed to parse POS_STARTER_MODFIFIER");
|
||||
CHECK_AND_ASSERT_THROW_MES(r, "Failed to parse POS_STARTER_KERNEL_HASH");
|
||||
}
|
||||
|
||||
wide_difficulty_type stake_difficulty = difficulty / stake_output_amount;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue