#include <validators.h>
Definition at line 139 of file validators.h.
◆ Validators()
Definition at line 169 of file validators.h.
169 : m_db(db), current_list_timestamp(0) {
170 testnet ? this->http_client.
set_server(this->testnet_endpoint_addr, this->testnet_endpoint_port, boost::none) :
171 this->http_client.
set_server(this->endpoint_addr, this->endpoint_port, boost::none);
172 this->testnet = testnet;
173 this->m_p2p = pprotocol;
bool set_server(const std::string &address, boost::optional< login > user, ssl_options_t ssl_options=ssl_support_t::e_ssl_support_autodetect)
◆ enable()
| void electroneum::basic::Validators::enable |
( |
| ) |
|
|
inline |
◆ getApplicablePublicKeys()
| vector<string> electroneum::basic::Validators::getApplicablePublicKeys |
( |
uint64_t |
height, |
|
|
bool |
convert_to_byte = false |
|
) |
| |
|
inline |
Definition at line 176 of file validators.h.
178 all_of(this->list.begin(), this->list.end(), [&
height, &keys, &convert_to_byte](std::unique_ptr<Validator> &v) {
179 if (v->isWithinRange(
height)) {
180 const string k = convert_to_byte ? unhex(v->getPublicKey()) : v->getPublicKey();
◆ getSerializedValidatorList()
| string electroneum::basic::Validators::getSerializedValidatorList |
( |
| ) |
|
|
inline |
Definition at line 250 of file validators.h.
256 return this->serialized_v_list;
◆ getValidatorByKey()
| Validator electroneum::basic::Validators::getValidatorByKey |
( |
string |
key | ) |
|
|
inline |
Definition at line 188 of file validators.h.
190 all_of(this->list.begin(), this->list.end(), [&
key, &result](std::unique_ptr<Validator> &v) {
191 if (v->getPublicKey() ==
key) {
192 result = v->getValidatorInfo();
◆ isEnabled()
| bool electroneum::basic::Validators::isEnabled |
( |
| ) |
|
|
inline |
◆ isValid()
| bool electroneum::basic::Validators::isValid |
( |
| ) |
|
|
inline |
◆ loadValidatorsList()
| bool electroneum::basic::Validators::loadValidatorsList |
( |
| ) |
|
|
inline |
Definition at line 199 of file validators.h.
207 LOG_PRINT_L1(
"Unable to get validator_list json from " << this->endpoint_addr <<
":" << this->endpoint_port);
210 this->timeout = 60*60*24;
214 MGINFO(
"Validators list loaded from JSON endpoint! Refresh in 12 hours");
220 this->timeout = 60*60*1;
221 MGINFO(
"Validators list loaded from peers! Refresh in 1 hour");
235 this->timeout = 60*60*1;
238 MGINFO(
"Validators list loaded from database! Refresh in 1 hour");
virtual bool request_validators_list_to_all()=0
list_update_outcome setValidatorsList(const string &v_list, bool saveToDB, bool isEmergencyUpdate=false)
virtual std::string get_validator_list() const =0
bool get_http_json(const boost::string_ref uri, t_response &result_struct, t_transport &transport, std::chrono::milliseconds timeout=std::chrono::seconds(15), const boost::string_ref method="GET")
◆ on_idle()
| void electroneum::basic::Validators::on_idle |
( |
| ) |
|
|
inline |
Definition at line 278 of file validators.h.
bool loadValidatorsList()
bool do_call(functor_t functr)
◆ setValidatorsList()
Definition at line 259 of file validators.h.
263 return validate_and_update(
res, saveToDB, isEmergencyUpdate);
bool load_t_from_json(t_struct &out, const std::string &json_buff)
The documentation for this class was generated from the following files:
- /home/abuild/rpmbuild/BUILD/electroneum-5.0.0.4/src/cryptonote_basic/validators.h
- /home/abuild/rpmbuild/BUILD/electroneum-5.0.0.4/src/cryptonote_basic/validators.cpp