Skip to content

Commit

Permalink
Merge pull request #94 from ava-labs/fix/mempool-limit
Browse files Browse the repository at this point in the history
typo
  • Loading branch information
rajranjan0608 authored May 3, 2023
2 parents e4614c8 + 2de9e7d commit 7720602
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions vms/evm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,17 +126,17 @@ export default class EVM {
}
}

const requestId = Math.random().toString()
const requestId = receiver + id + Math.random().toString()

this.processRequest({ receiver, amount, id, requestId })

// After transaction is being processed, the nonce will be available and txHash can be returned to user
const waitingForNonce = setInterval(async () => {
if (this.hasNonce.get(receiver+id+requestId) != undefined) {
if (this.hasNonce.get(requestId) != undefined) {
clearInterval(waitingForNonce)

const nonce: number | undefined = this.hasNonce.get(receiver + id)
this.hasNonce.set(receiver + id, undefined)
const nonce: number | undefined = this.hasNonce.get(requestId)
this.hasNonce.set(requestId, undefined)

const { txHash } = await this.getTransaction(receiver, amount, nonce, id)

Expand Down Expand Up @@ -249,7 +249,7 @@ export default class EVM {

if (this.balanceCheck(req)) {
this.queue.push({ ...req, nonce: this.nonce })
this.hasNonce.set(req.receiver+req.id+req.requestId, this.nonce)
this.hasNonce.set(req.requestId!, this.nonce)
this.nonce++
this.executeQueue()
} else {
Expand Down

0 comments on commit 7720602

Please sign in to comment.