minor improvements and compilation fixes

This commit is contained in:
sowle 2022-12-02 18:14:19 +01:00
parent 39da73c42e
commit dac549f0b6
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC
3 changed files with 9 additions and 4 deletions

View file

@ -408,7 +408,7 @@ bool generate_genesis(const std::string& path_config, uint64_t premine_split_amo
ss.str("");
ss.clear();
std::cout << ENDL << "PROOF PHRASE: " << gcp.proof_string << ENDL;
construct_miner_tx(0, 0, 0, 0, 0, destinations, bl.miner_tx, TRANSACTION_VERSION_PRE_HF4, gcp.proof_string, CURRENCY_MINER_TX_MAX_OUTS);
// construct_miner_tx(0, 0, 0, 0, 0, destinations, bl.miner_tx, TRANSACTION_VERSION_PRE_HF4, gcp.proof_string, CURRENCY_MINER_TX_MAX_OUTS); <-- temporarily commented out; this overload needs to be re-implemented -- sowle
currency::blobdata txb = tx_to_blob(bl.miner_tx);
//self validate block

View file

@ -67,13 +67,18 @@ namespace currency
if (found)
{
found = true;
const boost::multiprecision::uint256_t d_mp = lhs / (crypto::c_zarcanum_z_coeff_mp * this->stake_amount) + 1;
const boost::multiprecision::uint256_t ba = d_mp * crypto::c_zarcanum_z_coeff_mp * this->stake_amount - lhs;
const boost::multiprecision::uint256_t l_div_z_D = this->z_l_div_z_D / crypto::c_zarcanum_z_coeff_mp;
LOG_PRINT_GREEN("Found Zarcanum kernel: amount: " << currency::print_money_brief(this->stake_amount) << /* ", gindex: " << td.m_global_output_index << */ ENDL
<< "difficulty: " << this->basic_diff << ENDL
<< "kernel info: " << ENDL
<< print_stake_kernel_info(this->sk)
<< "kernel_hash: " << this->kernel_hash << ENDL
<< "lhs: " << crypto::scalar_t(lhs) << ENDL
<< "rhs: " << crypto::scalar_t(rhs)
<< "lhs: 0x" << crypto::scalar_t(lhs).to_string_as_hex_number() << " = 0x" << std::hex << d_mp << " * 2^64 * " << this->stake_amount << " - 0x" << std::hex << ba << ENDL
<< "rhs: 0x" << crypto::scalar_t(rhs).to_string_as_hex_number() << ENDL
<< "d: 0x" << std::hex << d_mp << ENDL
<< "l / floor(z * D): 0x" << std::hex << l_div_z_D
, LOG_LEVEL_0);
}

View file

@ -306,7 +306,7 @@ void run_emulation(const std::string& path)
perform_simulation_for_function(timestamp_to_hashrate, current_index, blocks, result_blocks, \
[&](std::vector<uint64_t>& timestamps, std::vector<currency::wide_difficulty_type>& cumulative_difficulties, size_t target_seconds) \
{ \
return func_name(timestamps, cumulative_difficulties, target_seconds); \
return func_name(timestamps, cumulative_difficulties, target_seconds, DIFFICULTY_POW_STARTER); \
}); \
current_index+=2;