mirror of https://github.com/poanetwork/hbbft.git
Add logging to simulation example.
This commit is contained in:
parent
f970272d3e
commit
fc599232aa
|
@ -1,6 +1,7 @@
|
|||
extern crate bincode;
|
||||
extern crate colored;
|
||||
extern crate docopt;
|
||||
extern crate env_logger;
|
||||
extern crate hbbft;
|
||||
extern crate itertools;
|
||||
extern crate rand;
|
||||
|
@ -394,6 +395,7 @@ fn parse_args() -> Result<Args, docopt::Error> {
|
|||
}
|
||||
|
||||
fn main() {
|
||||
env_logger::init();
|
||||
let args = parse_args().unwrap_or_else(|e| e.exit());
|
||||
if args.flag_n <= 3 * args.flag_f {
|
||||
let msg = "Honey Badger only works if less than one third of the nodes are faulty.";
|
||||
|
|
|
@ -111,6 +111,11 @@ impl<NodeUid: Clone + Debug + Eq + Hash + Ord> DistAlgorithm for CommonSubset<No
|
|||
type Error = Error;
|
||||
|
||||
fn input(&mut self, input: Self::Input) -> CommonSubsetResult<()> {
|
||||
debug!(
|
||||
"{:?} Proposing {:?}",
|
||||
self.netinfo.our_uid(),
|
||||
HexBytes(&input)
|
||||
);
|
||||
self.send_proposed_value(input)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue