Skip to content

Commit 1c696ee

Browse files
author
MikhailK
committed
Fix mining loop (#94)
1 parent 437070c commit 1c696ee

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

nodes/poscan-consensus/src/service.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,14 @@ pub fn new_full(
460460
let patch_rot = parent_num >= REJECT_OLD_ALGO_SINCE.into();
461461
let mining_algo = if patch_rot { &POSCAN_ALGO_GRID2D_V3A } else { &POSCAN_ALGO_GRID2D_V3_1 };
462462

463-
let ver = client.runtime_version_at(&parent_id).unwrap();
463+
let ver = match client.runtime_version_at(&parent_id) {
464+
Ok(ver) => ver,
465+
Err(_) => {
466+
thread::sleep(Duration::new(1, 0));
467+
continue
468+
}
469+
};
470+
464471
if ver.spec_version < CONS_V2_SPEC_VER {
465472
let hashes = get_obj_hashes(mining_algo, &mp.pre_obj, &metadata.pre_hash, patch_rot);
466473
if hashes.len() > 0 {

0 commit comments

Comments
 (0)