diff --git a/coordinator/src/p2p.rs b/coordinator/src/p2p.rs index 8fdb2e81d..48a23aa5c 100644 --- a/coordinator/src/p2p.rs +++ b/coordinator/src/p2p.rs @@ -715,12 +715,12 @@ pub async fn handle_p2p_task( { if our_key == validator.0 { selected = true; - break; + continue; } } if !selected { log::debug!("received heartbeat and not selected to respond"); - return; + continue; } log::debug!("received heartbeat and selected to respond"); diff --git a/coordinator/src/tests/tributary/sync.rs b/coordinator/src/tests/tributary/sync.rs index 1af08fa82..9f01ca4df 100644 --- a/coordinator/src/tests/tributary/sync.rs +++ b/coordinator/src/tests/tributary/sync.rs @@ -121,8 +121,8 @@ async fn sync_test() { .map_err(|_| "failed to send ActiveTributary to heartbeat") .unwrap(); - // The heartbeat is once every 10 blocks - sleep(Duration::from_secs(10 * block_time)).await; + // The heartbeat is once every 10 blocks, with some limitations + sleep(Duration::from_secs(20 * block_time)).await; assert!(syncer_tributary.tip().await != spec.genesis()); // Verify it synced to the tip