mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-09 03:31:45 +00:00
Implement get_block_roots for syncing
This commit is contained in:
@@ -165,6 +165,15 @@ impl SimpleSync {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn on_beacon_block_roots_response(
|
||||
&mut self,
|
||||
peer_id: PeerId,
|
||||
reponse: BeaconBlockRootsResponse,
|
||||
network: &mut NetworkContext,
|
||||
) {
|
||||
//
|
||||
}
|
||||
|
||||
fn request_block_roots(
|
||||
&mut self,
|
||||
peer_id: PeerId,
|
||||
@@ -174,9 +183,12 @@ impl SimpleSync {
|
||||
) {
|
||||
// Potentially set state to sync.
|
||||
if self.state == SyncState::Idle && count > SLOT_IMPORT_TOLERANCE {
|
||||
debug!(self.log, "Entering downloading sync state.");
|
||||
self.state = SyncState::Downloading;
|
||||
}
|
||||
|
||||
debug!(self.log, "Requesting {} blocks from {:?}.", count, &peer_id);
|
||||
|
||||
// TODO: handle count > max count.
|
||||
network.send_rpc_request(
|
||||
peer_id.clone(),
|
||||
|
||||
Reference in New Issue
Block a user