aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/blockchain.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-01-13 21:03:54 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-01-13 21:06:14 +0000
commit50b230d12c3b9787928581603411738fea5ec3a0 (patch)
tree58b74b495346ed215d44afab04d69ebbc81d6f51 /src/cryptonote_core/blockchain.cpp
parentMerge pull request #1562 (diff)
downloadmonero-50b230d12c3b9787928581603411738fea5ec3a0.tar.xz
core: ensure block size limit is set from the start
It can now be queried by RPC, so it needs to be set before it is otherwise needed for consensus, even if no blocks had to be added (ie, exit and restart quickly).
Diffstat (limited to 'src/cryptonote_core/blockchain.cpp')
-rw-r--r--src/cryptonote_core/blockchain.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp
index de3af8e02..aabed36b2 100644
--- a/src/cryptonote_core/blockchain.cpp
+++ b/src/cryptonote_core/blockchain.cpp
@@ -375,6 +375,7 @@ bool Blockchain::init(BlockchainDB* db, const bool testnet, const cryptonote::te
LOG_PRINT_GREEN("Blockchain initialized. last block: " << m_db->height() - 1 << ", " << epee::misc_utils::get_time_interval_string(timestamp_diff) << " time ago, current difficulty: " << get_difficulty_for_next_block(), LOG_LEVEL_0);
m_db->block_txn_stop();
+ update_next_cumulative_size_limit();
return true;
}
//------------------------------------------------------------------
@@ -532,6 +533,7 @@ bool Blockchain::reset_and_set_genesis_block(const block& b)
block_verification_context bvc = boost::value_initialized<block_verification_context>();
add_new_block(b, bvc);
+ update_next_cumulative_size_limit();
return bvc.m_added_to_main_chain && !bvc.m_verifivation_failed;
}
//------------------------------------------------------------------