Skip to content

Commit

Permalink
fetchall only update if new tx fetched
Browse files Browse the repository at this point in the history
  • Loading branch information
estebanmino committed Jul 10, 2020
1 parent 6ac6037 commit 0db69d9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/transaction/TransactionController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -809,8 +809,10 @@ export class TransactionController extends BaseController<TransactionConfig, Tra
}
}
});

this.update({ transactions: allTxs });
// Update state only if new transactions were fetched
if (allTxs.length > this.state.transactions.length) {
this.update({ transactions: allTxs });
}
return latestIncomingTxBlockNumber;
}
}
Expand Down

0 comments on commit 0db69d9

Please sign in to comment.