-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Conversation
clients that are too far behind should not be tried to be updated |
_ => lagging_peers.iter().filter(|_| ::rand::random::<u8>() < 64u8).cloned().collect::<Vec<(usize, H256)>>() | ||
}; | ||
|
||
match lucky_peers.len() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could be just lucky_peers.resize(min(MIN_PEERS_PROPAGATION, lucky_peers.len()))
or lucky_peers.drain(...)
} | ||
|
||
fn create_latest_block_rlp(chain: &BlockChainClient) -> Bytes { | ||
chain.block(&chain.chain_info().best_block_hash).unwrap() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error should be handled here
trace!(target: "sync", "Sent new hashes to peers: {:?}", peers); | ||
} | ||
|
||
pub fn chain_blocks_verified(&mut self, io: &mut SyncIo) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing documentation.
would like to see a little bit of documentation on the private functions |
Conflicts: util/src/journaldb.rs
ah when writing tests in other branch discovered that packet for all propagades should contain difficulty as well
|
@@ -38,6 +38,8 @@ pub struct BlockQueueInfo { | |||
pub verified_queue_size: usize, | |||
/// Number of blocks being verified | |||
pub verifying_queue_size: usize, | |||
/// Indicates queue is empty | |||
pub empty: bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this really a necessary optimisation? (why not fn empty(&self) -> bool { verification.verified.is_empty() && verification.unverified.is_empty() && verification.verifying.is_empty() }
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
function for BlockQueueInfo?
seems reasonable
I guess 'full' should be function as well then, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- resolved
sends new known hashes to peers that probably have not got em