mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-11 20:01:08 +00:00
Continue from next round when re-building on same block (#582)
* keep rounds consistent when encountering bad block * fix interval logic * Fixed indentation
This commit is contained in:
committed by
Arkadiy Paronyan
parent
f12221c4e6
commit
f1cc82ae53
@@ -164,7 +164,11 @@ 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 && s.live_agreement() != Some(hash) {
|
||||
let last_agreement = s.last_agreement();
|
||||
let can_build_upon = last_agreement
|
||||
.map_or(true, |x| !x.live || x.parent_hash != hash);
|
||||
|
||||
if hash == prev_best && can_build_upon {
|
||||
debug!("Starting consensus round after a timeout");
|
||||
start_bft(best_block, s.clone());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user