Explorar o código

validatord/protocol_sync.rs: handle_receive_block correct flag value handling

aggstam %!s(int64=4) %!d(string=hai) anos
pai
achega
d7bf42a67f

+ 1 - 1
script/research/validatord/src/main.rs

@@ -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();

+ 1 - 1
script/research/validatord/src/protocols/protocol_sync.rs

@@ -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())?;