validatord/protocol_sync.rs: handle_receive_block correct flag value handling

This commit is contained in:
aggstam
2022-04-21 20:02:10 +03:00
parent 66baa52e91
commit d7bf42a67f
2 changed files with 2 additions and 2 deletions

View File

@@ -315,7 +315,7 @@ async fn start(executor: Arc<Executor<'_>>, opts: &Opt) -> Result<()> {
// Adding ProtocolSync to the registry
let state2 = state.clone();
let consensus_mode = false; // This flag should be based on staking
let consensus_mode = true; // This flag should be based on staking
registry
.register(net::SESSION_ALL, move |channel, main_p2p| {
let state = state2.clone();

View File

@@ -90,7 +90,7 @@ impl ProtocolSync {
// Consensus mode enabled nodes have already performed this steps,
// during proposal finalization.
// Extra validations can be added here.
if self.consensus_mode {
if !self.consensus_mode {
let info_copy = (*info).clone();
if !self.state.read().unwrap().blockchain.has_block(&info_copy)? {
self.state.write().unwrap().blockchain.add_by_info(info_copy.clone())?;