fix: set date in advance to prevent multiple requests from the same address

Signed-off-by: 170210 <j170210@icloud.com>
This commit is contained in:
170210 2024-02-27 20:07:29 +09:00
parent 6c610331d4
commit 19251b9f34
No known key found for this signature in database
GPG Key ID: 6025ACD88E4928F0

View File

@ -83,9 +83,9 @@ export class Webserver {
}
try {
await faucet.credit(address, matchingDenom);
// Count addresses to prevent draining
this.addressCounter.set(address, new Date());
await faucet.credit(address, matchingDenom);
} catch (e) {
console.error(e);
throw new HttpError(500, "Sending tokens failed");