mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-27 13:23:29 +01:00
core: fix miner tx block reward with fees
This commit is contained in:
parent
02ee0db6c5
commit
97638b1fb7
@ -126,20 +126,19 @@ namespace cryptonote
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// from hard fork 2, we cut out the low significant digits. This makes the tx smaller, and
|
|
||||||
// keeps the paid amount almost the same. The unpaid remainder gets pushed back to the
|
|
||||||
// emission schedule
|
|
||||||
if (hard_fork_version >= 2)
|
|
||||||
{
|
|
||||||
block_reward = block_reward - block_reward % ::config::BASE_REWARD_CLAMP_THRESHOLD;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if defined(DEBUG_CREATE_BLOCK_TEMPLATE)
|
#if defined(DEBUG_CREATE_BLOCK_TEMPLATE)
|
||||||
LOG_PRINT_L1("Creating block template: reward " << block_reward <<
|
LOG_PRINT_L1("Creating block template: reward " << block_reward <<
|
||||||
", fee " << fee)
|
", fee " << fee)
|
||||||
#endif
|
#endif
|
||||||
block_reward += fee;
|
block_reward += fee;
|
||||||
|
|
||||||
|
// from hard fork 2, we cut out the low significant digits. This makes the tx smaller, and
|
||||||
|
// keeps the paid amount almost the same. The unpaid remainder gets pushed back to the
|
||||||
|
// emission schedule
|
||||||
|
if (hard_fork_version >= 2) {
|
||||||
|
block_reward = block_reward - block_reward % ::config::BASE_REWARD_CLAMP_THRESHOLD;
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<uint64_t> out_amounts;
|
std::vector<uint64_t> out_amounts;
|
||||||
decompose_amount_into_digits(block_reward, hard_fork_version >= 2 ? 0 : ::config::DEFAULT_DUST_THRESHOLD,
|
decompose_amount_into_digits(block_reward, hard_fork_version >= 2 ? 0 : ::config::DEFAULT_DUST_THRESHOLD,
|
||||||
[&out_amounts](uint64_t a_chunk) { out_amounts.push_back(a_chunk); },
|
[&out_amounts](uint64_t a_chunk) { out_amounts.push_back(a_chunk); },
|
||||||
|
Loading…
Reference in New Issue
Block a user