Skip to content

Commit

Permalink
Fix mining loop (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
MikhailK committed Aug 7, 2024
1 parent 437070c commit 1c696ee
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion nodes/poscan-consensus/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,14 @@ pub fn new_full(
let patch_rot = parent_num >= REJECT_OLD_ALGO_SINCE.into();
let mining_algo = if patch_rot { &POSCAN_ALGO_GRID2D_V3A } else { &POSCAN_ALGO_GRID2D_V3_1 };

let ver = client.runtime_version_at(&parent_id).unwrap();
let ver = match client.runtime_version_at(&parent_id) {
Ok(ver) => ver,
Err(_) => {
thread::sleep(Duration::new(1, 0));
continue
}
};

if ver.spec_version < CONS_V2_SPEC_VER {
let hashes = get_obj_hashes(mining_algo, &mp.pre_obj, &metadata.pre_hash, patch_rot);
if hashes.len() > 0 {
Expand Down

0 comments on commit 1c696ee

Please sign in to comment.