mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Add "self" to all session stats records
This commit is contained in:
parent
71342bdcd4
commit
e6984e4799
13 changed files with 47 additions and 38 deletions
|
@ -222,6 +222,7 @@ struct NewValidatorGroupStats {
|
|||
BlockSeqno last_key_block_seqno = 0;
|
||||
double started_at = -1.0;
|
||||
td::uint32 self_idx = 0;
|
||||
PublicKeyHash self = PublicKeyHash::zero();
|
||||
std::vector<Node> nodes;
|
||||
|
||||
tl_object_ptr<ton_api::validatorStats_newValidatorGroup> tl() const {
|
||||
|
@ -232,7 +233,7 @@ struct NewValidatorGroupStats {
|
|||
}
|
||||
return create_tl_object<ton_api::validatorStats_newValidatorGroup>(session_id, create_tl_shard_id(shard), cc_seqno,
|
||||
last_key_block_seqno, started_at, self_idx,
|
||||
std::move(nodes_arr));
|
||||
self.bits256_value(), std::move(nodes_arr));
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -244,6 +245,7 @@ struct EndValidatorGroupStats {
|
|||
|
||||
ValidatorSessionId session_id = ValidatorSessionId::zero();
|
||||
double timestamp = -1.0;
|
||||
PublicKeyHash self = PublicKeyHash::zero();
|
||||
std::vector<Node> nodes;
|
||||
|
||||
tl_object_ptr<ton_api::validatorStats_endValidatorGroup> tl() const {
|
||||
|
@ -252,7 +254,8 @@ struct EndValidatorGroupStats {
|
|||
nodes_arr.push_back(create_tl_object<ton_api::validatorStats_endValidatorGroup_node>(node.id.bits256_value(),
|
||||
node.catchain_blocks));
|
||||
}
|
||||
return create_tl_object<ton_api::validatorStats_endValidatorGroup>(session_id, timestamp, std::move(nodes_arr));
|
||||
return create_tl_object<ton_api::validatorStats_endValidatorGroup>(session_id, timestamp, self.bits256_value(),
|
||||
std::move(nodes_arr));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -1036,7 +1036,7 @@ void ValidatorSessionImpl::get_end_stats(td::Promise<EndValidatorGroupStats> pro
|
|||
promise.set_error(td::Status::Error(ErrorCode::notready, "not started"));
|
||||
return;
|
||||
}
|
||||
EndValidatorGroupStats stats{.session_id = unique_hash_, .timestamp = td::Clocks::system()};
|
||||
EndValidatorGroupStats stats{.session_id = unique_hash_, .timestamp = td::Clocks::system(), .self = local_id()};
|
||||
stats.nodes.resize(description().get_total_nodes());
|
||||
for (size_t i = 0; i < stats.nodes.size(); ++i) {
|
||||
stats.nodes[i].id = description().get_source_id(i);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue