fn collect_garbage(&mut self, nonces_for_accounts: &HashMap<Address, Nonce>) {
        self.nonces_by_account.retain(|address, account_nonces| {
            let stored_nonce = nonces_for_accounts
                .get(address)
                .copied()
                .unwrap_or(Nonce(0));
            // Retain only nonces starting from the stored one, and remove transactions with all past nonces;
            // this includes both successfully executed and replaced transactions.
            let retained_nonces = account_nonces.split_off(&stored_nonce);
            for &nonce in &*account_nonces {
                if let Some(tx_hashes) = self.tx_hashes_by_initiator.remove(&(*address, nonce)) {
                    for tx_hash in tx_hashes {
                        self.transactions_by_hash.remove(&tx_hash);
                    }
                }
            }
            *account_nonces = retained_nonces;
            // If we've removed all nonces, drop the account entry so we don't request stored nonces for it later.
            !account_nonces.is_empty()
        });
    }
Removes transactions from the cache based on nonces for accounts loaded from Postgres.
core/node/api_server/src/tx_sender/proxy.rs