Restructuring hp.cfg consensus and npl blocks (#365)

This commit is contained in:
Udith Indrakantha
2022-07-22 11:36:06 +05:30
committed by GitHub
parent 69481e5265
commit 2a4a7d3b34
11 changed files with 95 additions and 56 deletions

View File

@@ -50,7 +50,7 @@ namespace msg::usrmsg::bson
encoder.key(msg::usrmsg::FLD_VOTE_STATUS);
encoder.string_value(msg::usrmsg::VOTE_STATUSES[vote_status]);
encoder.key(msg::usrmsg::FLD_ROUND_TIME);
encoder.uint64_value(conf::cfg.contract.roundtime);
encoder.uint64_value(conf::cfg.contract.consensus.roundtime);
encoder.key(msg::usrmsg::FLD_CONTARCT_EXECUTION_ENABLED);
encoder.bool_value(conf::cfg.contract.execute);
encoder.key(msg::usrmsg::FLD_READ_REQUESTS_ENABLED);

View File

@@ -42,7 +42,7 @@ namespace msg::fbuf::p2pmsg
if (session && session->challenge_status == comm::CHALLENGE_STATUS::CHALLENGE_VERIFIED && message.size() <= MAX_SIZE_FOR_TIME_CHECK)
{
const uint64_t time_now = util::get_epoch_milliseconds();
if (p2p_msg->created_on() < (time_now - (conf::cfg.contract.roundtime * 3)))
if (p2p_msg->created_on() < (time_now - (conf::cfg.contract.consensus.roundtime * 3)))
{
LOG_DEBUG << "Peer message is too old. type:" << p2p_msg->content_type() << " from:" << (session ? session->display_name() : "");
return p2p::peer_message_info{NULL, P2PMsgContent_NONE, 0};

View File

@@ -180,7 +180,7 @@ namespace msg::usrmsg::json
msg += SEP_COMMA;
msg += msg::usrmsg::FLD_ROUND_TIME;
msg += SEP_COLON_NOQUOTE;
msg += std::to_string(conf::cfg.contract.roundtime);
msg += std::to_string(conf::cfg.contract.consensus.roundtime);
msg += SEP_COMMA_NOQUOTE;
msg += msg::usrmsg::FLD_CONTARCT_EXECUTION_ENABLED;
msg += SEP_COLON_NOQUOTE;