mirror of
https://github.com/monero-project/monero.git
synced 2024-10-01 11:49:47 -04:00
save some database calls when getting top block hash and height
This commit is contained in:
parent
3bbc366147
commit
8461df0405
@ -3126,6 +3126,7 @@ bool Blockchain::check_fee(size_t tx_weight, uint64_t fee) const
|
|||||||
if (version >= HF_VERSION_DYNAMIC_FEE)
|
if (version >= HF_VERSION_DYNAMIC_FEE)
|
||||||
{
|
{
|
||||||
median = m_current_block_cumul_weight_limit / 2;
|
median = m_current_block_cumul_weight_limit / 2;
|
||||||
|
const uint64_t blockchain_height = m_db->height();
|
||||||
already_generated_coins = blockchain_height ? m_db->get_block_already_generated_coins(blockchain_height - 1) : 0;
|
already_generated_coins = blockchain_height ? m_db->get_block_already_generated_coins(blockchain_height - 1) : 0;
|
||||||
if (!get_block_reward(median, 1, already_generated_coins, base_reward, version))
|
if (!get_block_reward(median, 1, already_generated_coins, base_reward, version))
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user