Skip to content

Commit

Permalink
Merge pull request #10 from ava-labs/hotfix
Browse files Browse the repository at this point in the history
Minimizing captcha score and failed Tx handling
  • Loading branch information
rajranjan0608 authored May 25, 2022
2 parents 5c38adf + ed42d46 commit 23eb300
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion middlewares/verifyCaptcha.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class VerifyCaptcha {
const data = response?.data;

if(data?.success) {
if(data?.score > 0.6) {
if(data?.score >= 0.3) {
return true;
}
}
Expand Down
9 changes: 8 additions & 1 deletion vms/evm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,14 @@ export default class EVM {
this.pendingTxNonces.delete(nonce);
} catch (err: any) {
console.log(err.message);
console.log(`Error with nonce ${nonce} while sending signed transaction.`);
console.log(`Error with nonce ${nonce} while sending signed transaction on ${this.NAME}.`);
if(err.message.includes("nonce too low")) {
console.log(`Nonce too low: Dropping transaction with nonce ${nonce} on ${this.NAME}`)
this.pendingTxNonces.delete(nonce);
} else {
console.log("Re-sending tx to faucet address");
this.sendTokenUtil(0, this.account.address, nonce)
}
}
}

Expand Down

0 comments on commit 23eb300

Please sign in to comment.