verify raw transactions against Engine

This commit is contained in:
Robert Habermeier
2017-02-09 19:58:29 +01:00
parent a559dfe9a1
commit 325c6aaf6a
2 changed files with 19 additions and 2 deletions

View File

@@ -16,9 +16,12 @@
//! Light client implementation. Stores data from light sync
use std::sync::Arc;
use ethcore::block_import_error::BlockImportError;
use ethcore::block_status::BlockStatus;
use ethcore::client::ClientReport;
use ethcore::engines::Engine;
use ethcore::ids::BlockId;
use ethcore::header::Header;
use ethcore::verification::queue::{self, HeaderQueue};
@@ -91,6 +94,7 @@ impl<T: LightChainClient> AsLightClient for T {
/// Light client implementation.
pub struct Client {
queue: HeaderQueue,
engine: Arc<Engine>,
chain: HeaderChain,
report: RwLock<ClientReport>,
import_lock: Mutex<()>,
@@ -101,6 +105,7 @@ impl Client {
pub fn new(config: Config, spec: &Spec, io_channel: IoChannel<ClientIoMessage>) -> Self {
Client {
queue: HeaderQueue::new(config.queue, spec.engine.clone(), io_channel, true),
engine: spec.engine.clone(),
chain: HeaderChain::new(&::rlp::encode(&spec.genesis_header())),
report: RwLock::new(ClientReport::default()),
import_lock: Mutex::new(()),
@@ -200,6 +205,11 @@ impl Client {
self.chain.heap_size_of_children()
}
/// Get a handle to the verification engine.
pub fn engine(&self) -> &Engine {
&*self.engine
}
}
impl LightChainClient for Client {