@@ -363,7 +363,7 @@ export const FaucetRoutes: FastifyPluginAsync<
363363 . map ( r => now - r . occurred_at )
364364 . filter ( r => r <= window ) ;
365365 if ( requestsInWindow . length >= triggerCount ) {
366- logger . warn ( `STX faucet rate limit hit for address ${ recipientAddress } ` ) ;
366+ logger . warn ( `StxFaucet rate limit hit for address ${ recipientAddress } ` ) ;
367367 return await reply . status ( 429 ) . send ( {
368368 error : 'Too many requests' ,
369369 success : false ,
@@ -372,12 +372,12 @@ export const FaucetRoutes: FastifyPluginAsync<
372372
373373 // Start with a random key index. We will try others in order if this one fails.
374374 let keyIndex = Math . round ( Math . random ( ) * ( STX_FAUCET_KEYS . length - 1 ) ) ;
375- let attempts = 0 ;
375+ let keysAttempted = 0 ;
376376 let sendSuccess : { txId : string ; txRaw : string } | undefined ;
377377 const stxAmount = await calculateSTXFaucetAmount ( STX_FAUCET_NETWORK , isStackingReq ) ;
378378 const rpcClient = clientFromNetwork ( STX_FAUCET_NETWORK ) ;
379379 do {
380- attempts ++ ;
380+ keysAttempted ++ ;
381381 const senderKey = STX_FAUCET_KEYS [ keyIndex ] ;
382382 const senderAddress = getAddressFromPrivateKey ( senderKey , TransactionVersion . Testnet ) ;
383383 logger . debug ( `StxFaucet attempting faucet transaction from sender: ${ senderAddress } ` ) ;
@@ -401,8 +401,8 @@ export const FaucetRoutes: FastifyPluginAsync<
401401 error . message ?. includes ( 'ConflictingNonceInMempool' ) ||
402402 error . message ?. includes ( 'TooMuchChaining' )
403403 ) {
404- if ( attempts == STX_FAUCET_KEYS . length ) {
405- logger . error (
404+ if ( keysAttempted == STX_FAUCET_KEYS . length ) {
405+ logger . warn (
406406 `StxFaucet attempts exhausted for all faucet keys. Last error: ${ error } `
407407 ) ;
408408 throw error ;
0 commit comments