diff --git a/cmd/vote.go b/cmd/vote.go index 6b1f03d8a..13dcb53f8 100644 --- a/cmd/vote.go +++ b/cmd/vote.go @@ -178,11 +178,18 @@ func (*UtilsStruct) HandleBlock(client *ethclient.Client, account types.Account, log.Error("Error in getting sRZR balance for staker: ", err) return } - sRZRInEth, err := razorUtils.ConvertWeiToEth(sRZRBalance) - if err != nil { - log.Error(err) - return + + var sRZRInEth *big.Float + if sRZRBalance.Cmp(big.NewInt(0)) == 0 { + sRZRInEth = big.NewFloat(0) + } else { + sRZRInEth, err = razorUtils.ConvertWeiToEth(sRZRBalance) + if err != nil { + log.Error(err) + return + } } + log.Infof("Block: %d Epoch: %d State: %s Staker ID: %d Stake: %f sRZR Balance: %f Eth Balance: %f", blockNumber, epoch, utils.UtilsInterface.GetStateName(state), stakerId, actualStake, sRZRInEth, actualBalance) if stakedAmount.Cmp(minStakeAmount) < 0 { log.Error("Stake is below minimum required. Cannot vote.")