Skip to content

Commit f589fd2

Browse files
committed
replace doAssert with return
1 parent 51ad833 commit f589fd2

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

beacon_chain/spec/beaconstate.nim

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2325,13 +2325,17 @@ iterator get_ptc*(state: gloas.BeaconState, slot: Slot):
23252325
epoch = slot.epoch()
23262326
state_epoch = get_current_epoch(state)
23272327
slot_in_epoch = slot mod SLOTS_PER_EPOCH
2328-
index =
2329-
if epoch < state_epoch:
2330-
doAssert epoch + 1 == state_epoch
2331-
slot_in_epoch
2332-
else:
2333-
doAssert epoch <= state_epoch + MIN_SEED_LOOKAHEAD
2334-
(epoch - state_epoch + 1).Epoch.start_slot.uint64 + slot_in_epoch
2328+
2329+
if epoch < state_epoch and epoch + 1 != state_epoch:
2330+
return
2331+
if epoch >= state_epoch and epoch > state_epoch + MIN_SEED_LOOKAHEAD:
2332+
return
2333+
2334+
let index =
2335+
if epoch < state_epoch:
2336+
slot_in_epoch
2337+
else:
2338+
(epoch - state_epoch + 1).Epoch.start_slot.uint64 + slot_in_epoch
23352339

23362340
for idx in state.ptc_window[index]:
23372341
yield ValidatorIndex(idx)

0 commit comments

Comments
 (0)