Skip to content

Commit 1c92865

Browse files
author
Jeff Yanta
committed
Nonce allocator should consider claimed state when determining number of potentially available nonces
1 parent 97af66c commit 1c92865

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

pkg/code/async/nonce/allocator.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ func (p *service) generateNonceAccountsOnSolanaMainnet(serviceCtx context.Contex
4343
return err
4444
}
4545

46+
num_claimed, err := p.data.GetNonceCountByState(tracedCtx, nonce.EnvironmentSolana, nonce.EnvironmentInstanceSolanaMainnet, nonce.StateClaimed)
47+
if err != nil {
48+
return err
49+
}
50+
4651
num_released, err := p.data.GetNonceCountByState(tracedCtx, nonce.EnvironmentSolana, nonce.EnvironmentInstanceSolanaMainnet, nonce.StateReleased)
4752
if err != nil {
4853
return err
@@ -55,7 +60,7 @@ func (p *service) generateNonceAccountsOnSolanaMainnet(serviceCtx context.Contex
5560

5661
// Get a count of nonces that are available or potentially available
5762
// within a short amount of time.
58-
num_potentially_available := num_available + num_released + num_unknown
63+
num_potentially_available := num_available + num_claimed + num_released + num_unknown
5964
if num_potentially_available >= p.conf.solanaMainnetNoncePoolSize.Get(serviceCtx) {
6065
if hasWarnedUser {
6166
p.log.Warn("The nonce pool size is reached.")

0 commit comments

Comments
 (0)