Skip to content

Commit

Permalink
fix: return early on 0 divisor
Browse files Browse the repository at this point in the history
  • Loading branch information
saiintbrisson committed Jun 4, 2024
1 parent 43fb24f commit b31d1bb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion node/chain-specs/main.json

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion pallets/subspace/src/step.rs
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,11 @@ failed to run yuma consensus algorithm: {err:?}, skipping this block. \
target_registrations_interval: u16,
target_registrations_per_interval: u16,
) {
if block_number % u64::from(target_registrations_interval) == 0 {
if target_registrations_interval == 0 {
return;
}

if block_number % target_registrations_interval as u64 == 0 {
let current_burn = Self::get_burn(netuid);

let adjusted_burn = Self::adjust_burn(
Expand Down

0 comments on commit b31d1bb

Please sign in to comment.