Skip to content

Commit 7f039fa

Browse files
authored
Merge pull request #1591 from DanShaders/simpler-mcreinit
Do not recompute validator set in MasterchainStateQ::mc_reinit
2 parents 560de02 + 22003ae commit 7f039fa

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

crypto/block/mc-config.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -643,8 +643,8 @@ class Config {
643643
const WorkchainSet& get_workchain_list() const {
644644
return workchains_;
645645
}
646-
const ValidatorSet* get_cur_validator_set() const {
647-
return cur_validators_.get();
646+
std::shared_ptr<ValidatorSet> const& get_cur_validator_set() const& {
647+
return cur_validators_;
648648
}
649649
std::pair<ton::UnixTime, ton::UnixTime> get_validator_set_start_stop(int next = 0) const;
650650
ton::ValidatorSessionConfig get_consensus_config() const;

validator/impl/shard.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -388,11 +388,8 @@ td::Status MasterchainStateQ::mc_reinit() {
388388
CHECK(config_);
389389
CHECK(config_->set_block_id_ext(get_block_id()));
390390

391-
auto cv_root = config_->get_config_param(35, 34);
392-
if (cv_root.not_null()) {
393-
TRY_RESULT(validators, block::Config::unpack_validator_set(std::move(cv_root), true));
394-
cur_validators_ = std::move(validators);
395-
}
391+
cur_validators_ = config_->get_cur_validator_set();
392+
396393
auto nv_root = config_->get_config_param(37, 36);
397394
if (nv_root.not_null()) {
398395
TRY_RESULT(validators, block::Config::unpack_validator_set(std::move(nv_root), true));

0 commit comments

Comments
 (0)