remove mocknet stuff, clean up debug

This commit is contained in:
keorn
2016-09-27 15:50:16 +01:00
parent 0c69d4a1ce
commit 28cf91c7a5
12 changed files with 13 additions and 451 deletions

View File

@@ -29,7 +29,6 @@ use evm::Schedule;
use ethjson;
use io::{IoContext, IoHandler, TimerToken, IoService, IoChannel};
use service::ClientIoMessage;
use time::get_time;
/// `AuthorityRound` params.
#[derive(Debug, PartialEq)]
@@ -119,7 +118,10 @@ impl IoHandler<BlockArrived> for TransitionHandler {
debug!(target: "authorityround", "Timeout step: {}", engine.step.load(AtomicOrdering::Relaxed));
engine.step.fetch_add(1, AtomicOrdering::SeqCst);
if let Some(ref channel) = *engine.message_channel.try_lock().unwrap() {
channel.send(ClientIoMessage::UpdateSealing);
match channel.send(ClientIoMessage::UpdateSealing) {
Ok(_) => trace!(target: "authorityround", "timeout: UpdateSealing message sent."),
Err(_) => trace!(target: "authorityround", "timeout: Could not send a sealing message."),
}
}
io.register_timer_once(ENGINE_TIMEOUT_TOKEN, engine.our_params.step_duration).expect("Failed to restart consensus step timer.")
}

View File

@@ -132,7 +132,7 @@ pub trait Engine : Sync + Send {
/// Panics if `is_builtin(a)` is not true.
fn execute_builtin(&self, a: &Address, input: &[u8], output: &mut BytesRef) { self.builtins().get(a).unwrap().execute(input, output); }
/// Add a channel for communication with Client.
fn register_message_channel(&self, message_channel: IoChannel<ClientIoMessage>) {}
/// Add a channel for communication with Client which can be used for sealing.
fn register_message_channel(&self, _message_channel: IoChannel<ClientIoMessage>) {}
// TODO: sealing stuff - though might want to leave this for later.
}