diff options
author | Riccardo Spagni <ric@spagni.net> | 2019-04-11 12:41:07 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2019-04-11 12:41:07 +0200 |
commit | 76fbcfe2ddf597b4d8f6d2f5e6f387d57db427eb (patch) | |
tree | 4d9fdf15d9e1eab2482dd11e3c8d2e69864e1765 /src/cryptonote_core/blockchain.cpp | |
parent | Merge pull request #4939 (diff) | |
parent | cryptonote: rework block blob size sanity check (diff) | |
download | monero-76fbcfe2ddf597b4d8f6d2f5e6f387d57db427eb.tar.xz |
Merge pull request #5123
089c7637 cryptonote: rework block blob size sanity check (moneromooo-monero)
Diffstat (limited to 'src/cryptonote_core/blockchain.cpp')
-rw-r--r-- | src/cryptonote_core/blockchain.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index 73c60760b..503267a1a 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -3873,6 +3873,8 @@ bool Blockchain::update_next_cumulative_weight_limit(uint64_t *long_term_effecti LOG_PRINT_L3("Blockchain::" << __func__); + m_db->block_txn_start(false); + // when we reach this, the last hf version is not yet written to the db const uint64_t db_height = m_db->height(); const uint8_t hf_version = get_current_hard_fork_version(); @@ -3935,6 +3937,10 @@ bool Blockchain::update_next_cumulative_weight_limit(uint64_t *long_term_effecti if (long_term_effective_median_block_weight) *long_term_effective_median_block_weight = m_long_term_effective_median_block_weight; + m_db->add_max_block_size(m_current_block_cumul_weight_limit); + + m_db->block_txn_stop(); + return true; } //------------------------------------------------------------------ |