Simplification and compiler error fix.

This commit is contained in:
cheatfate 2021-04-13 13:34:06 +03:00 committed by zah
parent fc5ca8ec35
commit c2c3fdb471
1 changed files with 3 additions and 7 deletions

View File

@ -166,13 +166,9 @@ proc installValidatorApiHandlers*(router: var RestRouter, node: BeaconNode) =
block:
var res: seq[RestProposerDutyTuple]
let epochRef = node.chainDag.getEpochRef(qhead, qepoch)
let startSlot =
# Fix for https://github.com/status-im/nimbus-eth2/issues/2488
# Slot(0) at Epoch(0) do not have a proposer.
if (qepoch == Epoch(0)) and (i == 0):
1
else:
0
let startSlot = if qepoch == Epoch(0): 1'u64 else: 0'u64
for i in startSlot ..< SLOTS_PER_EPOCH:
if epochRef.beacon_proposers[i].isSome():
let proposer = epochRef.beacon_proposers[i].get()