mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-09 11:41:51 +00:00
Remove sync crate, move into network crate
This commit is contained in:
@@ -2,16 +2,15 @@ use crate::beacon_chain::BeaconChain;
|
||||
use crate::error;
|
||||
use crate::messages::NodeMessage;
|
||||
use crate::service::NetworkMessage;
|
||||
use crate::sync::SimpleSync;
|
||||
use crossbeam_channel::{unbounded as channel, Sender};
|
||||
use futures::future;
|
||||
use futures::prelude::*;
|
||||
use libp2p::rpc;
|
||||
use libp2p::{PeerId, RPCEvent};
|
||||
use slog::debug;
|
||||
use std::collections::HashMap;
|
||||
use std::sync::Arc;
|
||||
use std::time::{Duration, Instant};
|
||||
use sync::SimpleSync;
|
||||
use types::Hash256;
|
||||
|
||||
/// Timeout for establishing a HELLO handshake.
|
||||
@@ -57,13 +56,11 @@ impl MessageHandler {
|
||||
let (handler_send, handler_recv) = channel();
|
||||
|
||||
// Initialise sync and begin processing in thread
|
||||
//TODO: Load genesis from BeaconChain
|
||||
//TODO: Initialise beacon chain
|
||||
let temp_genesis = Hash256::zero();
|
||||
|
||||
// generate the Message handler
|
||||
let sync = SimpleSync::new(temp_genesis);
|
||||
let sync = SimpleSync::new(beacon_chain.clone());
|
||||
|
||||
let mut handler = MessageHandler {
|
||||
// TODO: The handler may not need a chain, perhaps only sync?
|
||||
chain: beacon_chain.clone(),
|
||||
sync,
|
||||
network_send,
|
||||
|
||||
Reference in New Issue
Block a user