Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fiddle with logging
  • Loading branch information
rphmeier committed Aug 1, 2018
commit 33eada0807603147e1cad7615094c2f6f2828c55
14 changes: 9 additions & 5 deletions polkadot/consensus/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ fn start_bft<F, C>(
{
const DELAY_UNTIL: Duration = Duration::from_millis(5000);

debug!(target: "bft", "Starting agreement. Refusing to evaluate for {:?} from now.",
DELAY_UNTIL);

let mut handle = LocalThreadHandle::current();
let work = Delay::new(Instant::now() + DELAY_UNTIL)
.then(move |res| {
Expand All @@ -71,7 +68,14 @@ fn start_bft<F, C>(
}

match bft_service.build_upon(&header) {
Ok(maybe_bft_work) => maybe_bft_work,
Ok(maybe_bft_work) => {
if maybe_bft_work.is_some() {
debug!(target: "bft", "Starting agreement. After forced delay for {:?}",
DELAY_UNTIL);
}

maybe_bft_work
}
Err(e) => {
warn!(target: "bft", "BFT agreement error: {}", e);
None
Expand Down Expand Up @@ -156,7 +160,7 @@ impl Service {
interval.map_err(|e| debug!("Timer error: {:?}", e)).for_each(move |_| {
if let Ok(best_block) = c.best_block_header() {
let hash = best_block.hash();
if hash == prev_best {
if hash == prev_best && s.live_agreement() != Some(hash) {
debug!("Starting consensus round after a timeout");
start_bft(best_block, s.clone());
}
Expand Down