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

@@ -92,8 +92,8 @@ namespace p2p
{
// Npl messages and consensus proposals are forwarded only to unl nodes if relavent flags (npl and consensus) are set to private.
// If consensus and npl flags are public, these messages are forward to all the connected nodes.
const bool unl_only = (!conf::cfg.contract.is_npl_public && mi.type == p2pmsg::P2PMsgContent_NplMsg) ||
(!conf::cfg.contract.is_consensus_public && mi.type == p2pmsg::P2PMsgContent_ProposalMsg);
const bool unl_only = (conf::cfg.contract.npl.mode != conf::MODE::PUBLIC && mi.type == p2pmsg::P2PMsgContent_NplMsg) ||
(conf::cfg.contract.consensus.mode != conf::MODE::PUBLIC && mi.type == p2pmsg::P2PMsgContent_ProposalMsg);
if (need_consensus_msg_forwarding)
{
// Forward messages received by weakly connected nodes to other peers.