|
|
@@ -112,15 +112,6 @@ impl ProtocolSync {
|
|
|
}
|
|
|
|
|
|
async fn handle_receive_block(self: Arc<Self>) -> Result<()> {
|
|
|
- // Consensus-mode enabled nodes have already performed these steps,
|
|
|
- // during proposal finalization.
|
|
|
- if self.consensus_mode && self.state.read().await.consensus.participating.is_some() {
|
|
|
- debug!(
|
|
|
- "ProtocolSync::handle_receive_block(): node runs in consensus mode, skipping..."
|
|
|
- );
|
|
|
- return Ok(())
|
|
|
- }
|
|
|
-
|
|
|
debug!("ProtocolSync::handle_receive_block() [START]");
|
|
|
let exclude_list = vec![self.channel.address()];
|
|
|
loop {
|
|
|
@@ -132,6 +123,16 @@ impl ProtocolSync {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+ // Check if node started participating in consensus.
|
|
|
+ // Consensus-mode enabled nodes have already performed these steps,
|
|
|
+ // during proposal finalization.
|
|
|
+ if self.consensus_mode && self.state.read().await.consensus.participating.is_some() {
|
|
|
+ debug!(
|
|
|
+ "ProtocolSync::handle_receive_block(): node runs in consensus mode, skipping..."
|
|
|
+ );
|
|
|
+ return Ok(())
|
|
|
+ }
|
|
|
+
|
|
|
info!("ProtocolSync::handle_receive_block(): Received block: {}", info.blockhash());
|
|
|
|
|
|
debug!("ProtocolSync::handle_receive_block(): Processing received block");
|
|
|
@@ -204,15 +205,6 @@ impl ProtocolSync {
|
|
|
}
|
|
|
|
|
|
async fn handle_receive_slot_checkpoint(self: Arc<Self>) -> Result<()> {
|
|
|
- // Consensus-mode enabled nodes have already performed these steps,
|
|
|
- // during proposal finalization.
|
|
|
- if self.consensus_mode && self.state.read().await.consensus.participating.is_some() {
|
|
|
- debug!(
|
|
|
- "ProtocolSync::handle_receive_slot_checkpoint(): node runs in consensus mode, skipping..."
|
|
|
- );
|
|
|
- return Ok(())
|
|
|
- }
|
|
|
-
|
|
|
debug!("ProtocolSync::handle_receive_slot_checkpoint() [START]");
|
|
|
let exclude_list = vec![self.channel.address()];
|
|
|
loop {
|
|
|
@@ -224,6 +216,16 @@ impl ProtocolSync {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+ // Check if node started participating in consensus.
|
|
|
+ // Consensus-mode enabled nodes have already performed these steps,
|
|
|
+ // during proposal finalization.
|
|
|
+ if self.consensus_mode && self.state.read().await.consensus.participating.is_some() {
|
|
|
+ debug!(
|
|
|
+ "ProtocolSync::handle_receive_slot_checkpoint(): node runs in consensus mode, skipping..."
|
|
|
+ );
|
|
|
+ return Ok(())
|
|
|
+ }
|
|
|
+
|
|
|
info!(
|
|
|
"ProtocolSync::handle_receive_slot_checkpoint(): Received slot checkpoint: {}",
|
|
|
slot_checkpoint.slot
|