dispatching message return

This commit is contained in:
Nikolay Volf 2016-05-31 21:13:32 +02:00
parent 10d914d6c6
commit 495e7feb62

View File

@ -164,5 +164,12 @@ impl NetworkProtocolHandler<SyncMessage> for EthSync {
}
fn message(&self, io: &NetworkContext<SyncMessage>, message: &SyncMessage) {
match *message {
SyncMessage::NewChainBlocks { ref imported, ref invalid, ref enacted, ref retracted } => {
let mut sync_io = NetSyncIo::new(io, self.chain.deref());
self.sync.write().unwrap().chain_new_blocks(&mut sync_io, imported, invalid, enacted, retracted);
},
_ => {/* Ignore other messages */},
}
}
}