mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
updated submodules, bugfixes
- added new fift/func code for validator complaint creation - bugfixes in validator - updates in tonlib - new versions of rocksdb/abseil - hardfork support
This commit is contained in:
parent
16a4566091
commit
9f008b129f
129 changed files with 8438 additions and 879 deletions
|
@ -1785,6 +1785,31 @@ std::vector<ton::ValidatorDescr> ValidatorSet::export_validator_set() const {
|
|||
return l;
|
||||
}
|
||||
|
||||
std::map<ton::Bits256, int> ValidatorSet::compute_validator_map() const {
|
||||
std::map<ton::Bits256, int> res;
|
||||
for (int i = 0; i < (int)list.size(); i++) {
|
||||
res.emplace(list[i].pubkey.as_bits256(), i);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
std::vector<double> ValidatorSet::export_scaled_validator_weights() const {
|
||||
std::vector<double> res;
|
||||
for (const auto& node : list) {
|
||||
res.push_back((double)node.weight / (double)total_weight);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
int ValidatorSet::lookup_public_key(td::ConstBitPtr pubkey) const {
|
||||
for (int i = 0; i < (int)list.size(); i++) {
|
||||
if (list[i].pubkey.as_bits256() == pubkey) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
std::vector<ton::ValidatorDescr> Config::do_compute_validator_set(const block::CatchainValidatorsConfig& ccv_conf,
|
||||
ton::ShardIdFull shard,
|
||||
const block::ValidatorSet& vset, ton::UnixTime time,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue