Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
refactor using map
Browse files Browse the repository at this point in the history
  • Loading branch information
MicaiahReid committed Aug 12, 2022
1 parent 4ad9e9a commit 83d195b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/chains/ethereum/ethereum/src/transaction-pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -473,10 +473,9 @@ export default class TransactionPool extends Emittery<{ drain: undefined }> {
inProgress.forEach(transaction => {
transaction.locked = false;
const origin = transaction.from.toString();
if (pending.has(origin)) {
const txsFromOrigin = pending.get(origin);
const txsFromOrigin = pending.get(origin);
if (txsFromOrigin) {
txsFromOrigin.push(transaction);
pending.set(origin, txsFromOrigin);
} else {
const newHeap = Heap.from(transaction, byNonce);
pending.set(origin, newHeap);
Expand Down

0 comments on commit 83d195b

Please sign in to comment.