From a4fbd71a01e3a59e1d17da146092f0291fdcf180 Mon Sep 17 00:00:00 2001 From: Manav Darji Date: Wed, 25 Jan 2023 17:48:13 +0530 Subject: [PATCH] use internal function --- core/rawdb/bor_receipt.go | 3 +-- params/config.go | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/core/rawdb/bor_receipt.go b/core/rawdb/bor_receipt.go index 535b48ee48..f599eeee96 100644 --- a/core/rawdb/bor_receipt.go +++ b/core/rawdb/bor_receipt.go @@ -97,8 +97,7 @@ func ReadRawBorReceipt(db ethdb.Reader, hash common.Hash, number uint64) *types. // its correspoinding metadata fields. If it is unable to populate these metadata // fields then nil is returned. func ReadBorReceipt(db ethdb.Reader, hash common.Hash, number uint64, config *params.ChainConfig) *types.Receipt { - - if config != nil && !config.Bor.IsSprintStart(number, config.Bor.CalculateSprint(number)) { + if config != nil && !config.Bor.IsSprintStart(number) { return nil } diff --git a/params/config.go b/params/config.go index f410f772fd..9833c9eac5 100644 --- a/params/config.go +++ b/params/config.go @@ -617,8 +617,8 @@ func (c *BorConfig) IsDelhi(number *big.Int) bool { return isForked(c.DelhiBlock, number) } -func (c *BorConfig) IsSprintStart(number, sprint uint64) bool { - return number%sprint == 0 +func (c *BorConfig) IsSprintStart(number uint64) bool { + return number%c.CalculateSprint(number) == 0 } func (c *BorConfig) calculateBorConfigHelper(field map[string]uint64, number uint64) uint64 {