Propagate uncles (#1134)
This commit is contained in:
committed by
Gav Wood
parent
27380cdadb
commit
fba5082b00
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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>;
|
||||
|
||||
|
||||
@@ -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' ?
|
||||
|
||||
Reference in New Issue
Block a user