1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00

Add mempool messages cap

This commit is contained in:
OmicronTau 2021-11-13 17:15:19 +03:00 committed by EmelyanenkoK
parent 678a8a6a13
commit 69d0472510
7 changed files with 31 additions and 2 deletions

View file

@ -1309,6 +1309,9 @@ td::Status ValidatorEngine::load_global_config() {
if (state_ttl_ != 0) {
validator_options_.write().set_state_ttl(state_ttl_);
}
if (max_mempool_num_ != 0) {
validator_options_.write().set_max_mempool_num(max_mempool_num_);
}
if (block_ttl_ != 0) {
validator_options_.write().set_block_ttl(block_ttl_);
}
@ -3336,6 +3339,10 @@ int main(int argc, char *argv[]) {
auto v = td::to_double(fname);
acts.push_back([&x, v]() { td::actor::send_closure(x, &ValidatorEngine::set_state_ttl, v); });
});
p.add_option('m', "mempool-num", "Maximal number of mempool external message", [&](td::Slice fname) {
auto v = td::to_double(fname);
acts.push_back([&x, v]() { td::actor::send_closure(x, &ValidatorEngine::set_max_mempool_num, v); });
});
p.add_option('b', "block-ttl", "blocks will be gc'd after this time (in seconds) default=7*86400",
[&](td::Slice fname) {
auto v = td::to_double(fname);