change broadcast interface, add basic message handling

This commit is contained in:
keorn
2016-08-23 17:19:23 +02:00
parent 207f9d02f2
commit 99a143eb37
5 changed files with 22 additions and 12 deletions

View File

@@ -189,7 +189,7 @@ impl ChainNotify for EthSync {
self.network.stop().unwrap_or_else(|e| warn!("Error stopping network: {:?}", e));
}
fn broadcast(&self, message: Vec<u8>) {
fn broadcast(&self, message: &[u8]) {
self.network.with_context(ETH_PROTOCOL, |context| {
let mut sync_io = NetSyncIo::new(context, &*self.eth_handler.chain);
self.inf_handler.sync.write().propagate_packet(&mut sync_io, message.clone());