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

validator bugfix + old key blocks download improvement

This commit is contained in:
ton 2020-04-11 18:08:57 +04:00
parent be9c34c62d
commit 16a4566091
13 changed files with 315 additions and 121 deletions

View file

@ -1737,14 +1737,20 @@ bool ValidateQuery::register_shard_block_creators(std::vector<td::Bits256> creat
return true;
}
// similar to Collator::check_cur_validator_set()
bool ValidateQuery::check_cur_validator_set() {
CatchainSeqno cc_seqno = 0;
auto nodes = config_->compute_validator_set_cc(shard_, now_, &cc_seqno);
if (nodes.empty()) {
return reject_query("cannot compute masterchain validator set from old masterchain state");
return reject_query("cannot compute validator set for shard "s + shard_.to_str() + " from old masterchain state");
}
std::vector<ValidatorDescr> export_nodes;
if (validator_set_.not_null()) {
if (validator_set_->get_catchain_seqno() != cc_seqno) {
return reject_query(PSTRING() << "current validator set catchain seqno mismatch: this validator set has cc_seqno="
<< validator_set_->get_catchain_seqno() << ", only validator set with cc_seqno="
<< cc_seqno << " is entitled to create block " << id_.to_str());
}
export_nodes = validator_set_->export_vector();
}
if (export_nodes != nodes /* && !is_fake_ */) {