Skip to content

Commit 3593b3c

Browse files
committed
add some nonce buffer
1 parent f254d5d commit 3593b3c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

signer/cosigner_nonce_cache.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -199,12 +199,13 @@ func (cnc *CosignerNonceCache) getUuids(n int) []uuid.UUID {
199199
}
200200

201201
func (cnc *CosignerNonceCache) target(noncesPerMinute float64) int {
202+
buffer := 60
202203
t := int((noncesPerMinute / 60) *
203204
((cnc.getNoncesInterval.Seconds() * nonceOverallocation) + cnc.getNoncesTimeout.Seconds()))
204205
if t <= 0 {
205-
return 1 // always target at least one nonce ready
206+
t = 0
206207
}
207-
return t
208+
return t + buffer
208209
}
209210

210211
func (cnc *CosignerNonceCache) reconcile(ctx context.Context) {

0 commit comments

Comments
 (0)