diff --git a/packages/assets-controllers/src/AccountTrackerController.ts b/packages/assets-controllers/src/AccountTrackerController.ts index fb1f131cc7..15bc14ccd9 100644 --- a/packages/assets-controllers/src/AccountTrackerController.ts +++ b/packages/assets-controllers/src/AccountTrackerController.ts @@ -343,21 +343,24 @@ export class AccountTrackerController extends StaticIntervalPollingController< : [toChecksumHexAddress(selectedAccount.address)]; const accountsForChain = { ...accountsByChainId[chainId] }; + let balanceChanged = false; for (const address of accountsToUpdate) { const balance = await this.#getBalanceFromChain(address, ethQuery); - if (balance) { + if (balance && accountsForChain[address]?.balance !== balance) { accountsForChain[address] = { balance, }; + balanceChanged = true; } } - - this.update((state) => { - if (chainId === this.#getCurrentChainId()) { - state.accounts = accountsForChain; - } - state.accountsByChainId[chainId] = accountsForChain; - }); + if (balanceChanged) { + this.update((state) => { + if (chainId === this.#getCurrentChainId()) { + state.accounts = accountsForChain; + } + state.accountsByChainId[chainId] = accountsForChain; + }); + } } finally { releaseLock(); }