mirror of https://github.com/waku-org/nwaku.git
nonce to reset if limit is reached
This commit is contained in:
parent
68869a9b47
commit
f8d09d0181
|
@ -49,14 +49,16 @@ proc getNonce*(n: NonceManager): NonceManagerResult[Nonce] =
|
||||||
|
|
||||||
n.nextNonce = retNonce + 1
|
n.nextNonce = retNonce + 1
|
||||||
|
|
||||||
|
# This is modified for spam testing purposes, once the limit is reached the nonce value is reset to 0
|
||||||
if retNonce >= n.nonceLimit:
|
if retNonce >= n.nonceLimit:
|
||||||
return err(
|
retNonce = 0
|
||||||
NonceManagerError(
|
# return err(
|
||||||
kind: NonceLimitReached,
|
# NonceManagerError(
|
||||||
error:
|
# kind: NonceLimitReached,
|
||||||
"Nonce limit reached. Please wait for the next epoch. requested nonce: " &
|
# error:
|
||||||
$retNonce & " & nonceLimit: " & $n.nonceLimit,
|
# "Nonce limit reached. Please wait for the next epoch. requested nonce: " &
|
||||||
)
|
# $retNonce & " & nonceLimit: " & $n.nonceLimit,
|
||||||
)
|
# )
|
||||||
|
# )
|
||||||
|
|
||||||
return ok(retNonce)
|
return ok(retNonce)
|
||||||
|
|
Loading…
Reference in New Issue