complete quick'n'dirty light CLI

This commit is contained in:
Robert Habermeier
2017-03-22 22:00:52 +01:00
parent 73b2dd7a59
commit 83911a7290
4 changed files with 140 additions and 62 deletions

View File

@@ -662,6 +662,8 @@ pub struct LightSyncParams<L> {
pub network_id: u64,
/// Subprotocol name.
pub subprotocol_name: [u8; 3],
/// Other handlers to attach.
pub handlers: Vec<Arc<LightHandler>>,
}
/// Service for light synchronization.
@@ -696,6 +698,10 @@ impl LightSync {
let sync_handler = try!(SyncHandler::new(params.client.clone()));
light_proto.add_handler(Arc::new(sync_handler));
for handler in params.handlers {
light_proto.add_handler(handler);
}
Arc::new(light_proto)
};