aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/blockchain.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-04-04 00:15:57 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-04-05 09:35:19 +0000
commit089c7637a64652c8bcf6c437065237c23266d4a9 (patch)
tree1edb32e38080ab18184c0809ce0607c060682d05 /src/cryptonote_core/blockchain.cpp
parentMerge pull request #5390 (diff)
downloadmonero-089c7637a64652c8bcf6c437065237c23266d4a9.tar.xz
cryptonote: rework block blob size sanity check
Use the actual block weight limit, assuming that weight is always greater or equal to size
Diffstat (limited to 'src/cryptonote_core/blockchain.cpp')
-rw-r--r--src/cryptonote_core/blockchain.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp
index 83d3044f8..5925548d6 100644
--- a/src/cryptonote_core/blockchain.cpp
+++ b/src/cryptonote_core/blockchain.cpp
@@ -3872,6 +3872,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();
@@ -3934,6 +3936,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;
}
//------------------------------------------------------------------