From c2c3fdb471950c168f32b328ee79fda9c00d5f4d Mon Sep 17 00:00:00 2001 From: cheatfate Date: Tue, 13 Apr 2021 13:34:06 +0300 Subject: [PATCH] Simplification and compiler error fix. --- beacon_chain/rpc/validator_rest_api.nim | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/beacon_chain/rpc/validator_rest_api.nim b/beacon_chain/rpc/validator_rest_api.nim index 1b4a7f970..e4e5def9c 100644 --- a/beacon_chain/rpc/validator_rest_api.nim +++ b/beacon_chain/rpc/validator_rest_api.nim @@ -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 + # Fix for https://github.com/status-im/nimbus-eth2/issues/2488 + # Slot(0) at Epoch(0) do not have a proposer. + 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()