mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Add getvalidatorsessions query to validator-engine-console
This commit is contained in:
parent
9465fd866a
commit
849d995346
21 changed files with 181 additions and 4 deletions
|
|
@ -19,6 +19,7 @@
|
|||
#include "validator-session.hpp"
|
||||
#include "td/utils/Random.h"
|
||||
#include "td/utils/crypto.h"
|
||||
#include "ton/ton-tl.hpp"
|
||||
|
||||
namespace ton {
|
||||
|
||||
|
|
@ -937,6 +938,18 @@ void ValidatorSessionImpl::stats_set_candidate_status(td::uint32 round, PublicKe
|
|||
it->block_status = status;
|
||||
}
|
||||
|
||||
void ValidatorSessionImpl::get_session_info(
|
||||
td::Promise<tl_object_ptr<ton_api::engine_validator_validatorSessionInfo>> promise) {
|
||||
std::vector<td::Bits256> next_producers;
|
||||
for (td::uint32 round = cur_round_; round < cur_round_ + 20; ++round) {
|
||||
td::uint32 node = description().get_node_by_priority(round, 0);
|
||||
next_producers.push_back(description().get_source_id(node).bits256_value());
|
||||
}
|
||||
promise.set_result(create_tl_object<ton_api::engine_validator_validatorSessionInfo>(
|
||||
create_tl_block_id_simple(BlockId{}), description().get_source_id(local_idx()).bits256_value(),
|
||||
cur_round_, std::move(next_producers)));
|
||||
}
|
||||
|
||||
td::actor::ActorOwn<ValidatorSession> ValidatorSession::create(
|
||||
catchain::CatChainSessionId session_id, ValidatorSessionOptions opts, PublicKeyHash local_id,
|
||||
std::vector<ValidatorSessionNode> nodes, std::unique_ptr<Callback> callback,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue