From ed5aca195e7135c4056ee893354b3c659bbf1335 Mon Sep 17 00:00:00 2001 From: SpyCheese Date: Fri, 15 Sep 2023 19:19:50 +0300 Subject: [PATCH] Optional TON_FASTER_CC_BLOCKS --- validator-session/validator-session.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/validator-session/validator-session.cpp b/validator-session/validator-session.cpp index 245fae479..10293dc96 100644 --- a/validator-session/validator-session.cpp +++ b/validator-session/validator-session.cpp @@ -21,6 +21,7 @@ #include "td/utils/crypto.h" #include "ton/ton-tl.hpp" #include "candidate-serializer.h" +#include namespace ton { @@ -746,7 +747,15 @@ void ValidatorSessionImpl::request_new_block(bool now) { return; } requested_new_block_ = true; - if (now) { + static bool faster_cc_blocks = []() -> bool{ + const char* env = getenv("TON_FASTER_CC_BLOCKS"); + bool x = env && !strcmp(env, "1"); + if (x) { + LOG(ERROR) << "Enabled TON_FASTER_CC_BLOCKS"; + } + return x; + }(); + if (now || faster_cc_blocks) { requested_new_block_now_ = true; td::actor::send_closure(catchain_, &catchain::CatChain::need_new_block, td::Timestamp::now()); } else {