Skip to content

Commit

Permalink
Make atomics not pointers
Browse files Browse the repository at this point in the history
Signed-off-by: litt3 <[email protected]>
  • Loading branch information
litt3 committed Feb 4, 2025
1 parent 09a085b commit f37c5e3
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions api/clients/v2/verification/cert_verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ type CertVerifier struct {
ethClient *geth.EthClient
pollInterval time.Duration
// storage shared between goroutines, containing the most recent block number observed by calling ethClient.BlockNumber()
latestBlockNumber *atomic.Uint64
latestBlockNumber atomic.Uint64
// atomic bool, so that only a single goroutine is polling the internal client with BlockNumber() calls at any given time
pollingActive *atomic.Bool
pollingActive atomic.Bool
}

var _ ICertVerifier = &CertVerifier{}
Expand Down Expand Up @@ -79,16 +79,11 @@ func NewCertVerifier(
"pollInterval", pollInterval)
}

latestBlockNumber := atomic.Uint64{}
pollingActive := atomic.Bool{}

return &CertVerifier{
logger: logger,
certVerifierCaller: verifierCaller,
ethClient: ethClient,
pollInterval: pollInterval,
latestBlockNumber: &latestBlockNumber,
pollingActive: &pollingActive,
}, nil
}

Expand Down

0 comments on commit f37c5e3

Please sign in to comment.