Propagate uncles (#1134)

This commit is contained in:
Arkadiy Paronyan
2016-05-24 21:56:17 +02:00
committed by Gav Wood
parent 27380cdadb
commit fba5082b00
5 changed files with 24 additions and 5 deletions

View File

@@ -622,6 +622,10 @@ impl<V> BlockChainClient for Client<V> where V: Verifier {
}
}
fn find_uncles(&self, hash: &H256) -> Option<Vec<H256>> {
self.chain.find_uncle_hashes(hash, self.engine.maximum_uncle_age())
}
fn state_data(&self, hash: &H256) -> Option<Bytes> {
self.state_db.lock().unwrap().state(hash)
}

View File

@@ -93,6 +93,9 @@ pub trait BlockChainClient : Sync + Send {
/// See `BlockChain::tree_route`.
fn tree_route(&self, from: &H256, to: &H256) -> Option<TreeRoute>;
/// Get all possible uncle hashes for a block.
fn find_uncles(&self, hash: &H256) -> Option<Vec<H256>>;
/// Get latest state node
fn state_data(&self, hash: &H256) -> Option<Bytes>;

View File

@@ -348,6 +348,10 @@ impl BlockChainClient for TestBlockChainClient {
})
}
fn find_uncles(&self, _hash: &H256) -> Option<Vec<H256>> {
None
}
// TODO: returns just hashes instead of node state rlp(?)
fn state_data(&self, hash: &H256) -> Option<Bytes> {
// starts with 'f' ?