Cache the fork block header after snapshot restoration (#2391)

This commit is contained in:
Arkadiy Paronyan
2016-09-29 12:34:40 +02:00
committed by GitHub
parent 4d115987cb
commit 0e55b6c6c9
4 changed files with 48 additions and 14 deletions

View File

@@ -26,6 +26,7 @@ pub struct TestIo<'p> {
pub chain: &'p mut TestBlockChainClient,
pub queue: &'p mut VecDeque<TestPacket>,
pub sender: Option<PeerId>,
overlay: RwLock<HashMap<BlockNumber, Bytes>>,
}
impl<'p> TestIo<'p> {
@@ -33,7 +34,8 @@ impl<'p> TestIo<'p> {
TestIo {
chain: chain,
queue: queue,
sender: sender
sender: sender,
overlay: RwLock::new(HashMap::new()),
}
}
}
@@ -70,6 +72,10 @@ impl<'p> SyncIo for TestIo<'p> {
fn chain(&self) -> &BlockChainClient {
self.chain
}
fn chain_overlay(&self) -> &RwLock<HashMap<BlockNumber, Bytes>> {
&self.overlay
}
}
pub struct TestPacket {