diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-11-20 20:19:39 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2019-03-25 13:42:25 +0000 |
commit | 8461df0405474b4ae54cfa13f4dedb046f9185f6 (patch) | |
tree | cc78b68f472e7d14651c3bb8f38227a3c1d2dd69 /src | |
parent | Avoid repeated (de)serialization when syncing (diff) | |
download | monero-8461df0405474b4ae54cfa13f4dedb046f9185f6.tar.xz |
save some database calls when getting top block hash and height
Diffstat (limited to 'src')
-rw-r--r-- | src/cryptonote_core/blockchain.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index d110cc139..eb3c8d75b 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -3126,6 +3126,7 @@ bool Blockchain::check_fee(size_t tx_weight, uint64_t fee) const if (version >= HF_VERSION_DYNAMIC_FEE) { 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; if (!get_block_reward(median, 1, already_generated_coins, base_reward, version)) return false; |