mirror of https://github.com/poanetwork/hbbft.git
Fix comments.
This commit is contained in:
parent
2764e1e2e7
commit
b9adbab36a
|
@ -17,9 +17,9 @@ pub enum Message {
|
|||
Echo(Proof<Vec<u8>>),
|
||||
/// Indicates that the sender knows that every node will eventually be able to decode.
|
||||
Ready(Digest),
|
||||
/// Indicates that this node has enough shares to decode the message with given merkle root.
|
||||
/// Indicates that this node has enough shares to decode the message with given Merkle root.
|
||||
CanDecode(Digest),
|
||||
/// Indicates that sender can send an Echo for given merkle root.
|
||||
/// Indicates that sender can send an Echo for given Merkle root.
|
||||
EchoHash(Digest),
|
||||
}
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
//! * `CanDecode(h)` - Indicates node has enough chunks to recover message with merkle root `h`.
|
||||
//! * `EchoHash(h)` - Indicates node can send an `Echo(p[i])` message upon request.
|
||||
//!
|
||||
//! Let `g` be the `fault_estimate` i.e. the estimate of number of faulty nodes in the network
|
||||
//! Let _g_ be the `fault_estimate` i.e. the estimate of number of faulty nodes in the network
|
||||
//! that we want to optimize for.
|
||||
//! Note that the algorithm is still correct when more than `g` nodes are faulty.
|
||||
//!
|
||||
|
|
|
@ -17,8 +17,8 @@ pub enum Target<N> {
|
|||
/// The message must be sent to the node with the given ID.
|
||||
Node(N),
|
||||
/// The message must be sent to all remote nodes except the passed nodes.
|
||||
/// Useful for sending messages to Observer nodes that aren't
|
||||
/// present in a node's all_ids() list.
|
||||
/// Useful for sending messages to observer nodes that aren't
|
||||
/// present in a node's `all_ids()` list.
|
||||
AllExcept(BTreeSet<N>),
|
||||
}
|
||||
|
||||
|
|
|
@ -86,18 +86,6 @@ impl<N: NodeIdT> NetworkInfo<N> {
|
|||
self.public_keys.keys()
|
||||
}
|
||||
|
||||
/// ID of all nodes in the network except passed id.
|
||||
#[inline]
|
||||
pub fn all_ids_except<'a>(&'a self, id: &'a N) -> impl Iterator<Item = &'a N> + Clone {
|
||||
self.all_ids().filter(move |&x| x != id)
|
||||
}
|
||||
|
||||
/// ID of all nodes in the network except our id.
|
||||
#[inline]
|
||||
pub fn other_ids(&self) -> impl Iterator<Item = &N> + Clone {
|
||||
self.all_ids_except(self.our_id())
|
||||
}
|
||||
|
||||
/// The total number _N_ of nodes.
|
||||
#[inline]
|
||||
pub fn num_nodes(&self) -> usize {
|
||||
|
|
|
@ -295,7 +295,7 @@ where
|
|||
if filtered_nodes.values().all(is_accepted) {
|
||||
passed_msgs.push(msg);
|
||||
} else {
|
||||
// The `Target::All` message is split into two sets of point messages: those
|
||||
// The `Target::AllExcept` message is split into two sets of point messages: those
|
||||
// which can be sent without delay and those which should be postponed.
|
||||
for (id, them) in &filtered_nodes {
|
||||
if is_premature(them) {
|
||||
|
|
Loading…
Reference in New Issue