From 02e45cac01b57360fb3fd2645a388b6c42083984 Mon Sep 17 00:00:00 2001 From: YashK Date: Thu, 12 Sep 2024 15:40:45 +0530 Subject: [PATCH] refactor: reduced number of retry attempts --- cmd/vote.go | 3 +++ core/constants.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/vote.go b/cmd/vote.go index 3edd95b1..e7d11dc0 100644 --- a/cmd/vote.go +++ b/cmd/vote.go @@ -201,6 +201,9 @@ func (*UtilsStruct) HandleBlock(client *ethclient.Client, account types.Account, log.Error("Error in getting remaining time of the current state: ", err) return } + if remainingTimeOfTheCurrentState <= 0 { + return + } ctx, cancel := context.WithTimeout(context.Background(), time.Duration(remainingTimeOfTheCurrentState)*time.Second) defer cancel() diff --git a/core/constants.go b/core/constants.go index be91d650..f35fb7bd 100644 --- a/core/constants.go +++ b/core/constants.go @@ -17,7 +17,7 @@ const ( // ChainId corresponds to the EUROPA chain var ChainId = big.NewInt(0x79f99296) -const MaxRetries uint = 8 +const MaxRetries uint = 4 var NilHash = common.Hash{0x00}