There can be a race condition here if multiple requests are sent in short time period. Each requests will result in calling postcardLimiter.canSend which leads to calling postcardLimiter.get. If there are too many requests, they all get the same value from .get() and thus .canSend() is true for all of them, so they can exceed the limit.
(Bug)
report (i.e. something doesn't work as it should)https://github.com/poanetwork/poa-popa/blob/e259cec1fcfcfdff30a52bffb395d845c774855b/web-dapp/controllers/notifyRegTx.js#L112-L120
There can be a race condition here if multiple requests are sent in short time period. Each requests will result in calling
postcardLimiter.canSend
which leads to callingpostcardLimiter.get
. If there are too many requests, they all get the same value from.get()
and thus.canSend()
is true for all of them, so they can exceed the limit.