Skip to content

Commit

Permalink
use internal function
Browse files Browse the repository at this point in the history
  • Loading branch information
manav2401 committed Jan 25, 2023
1 parent c450f29 commit a4fbd71
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions core/rawdb/bor_receipt.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
4 changes: 2 additions & 2 deletions params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit a4fbd71

Please sign in to comment.