Merge pull request #4600 from oa-s/#4599

Fix memory leak for Erc1155BalanceFetcher #4599
pull/4596/head
Crypto Pank 3 years ago committed by GitHub
commit 2b5b3f1e41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      AlphaWallet/Core/Coordinators/WalletBalance/PrivateBalanceFetcher.swift

@ -466,7 +466,7 @@ class PrivateBalanceFetcher: PrivateBalanceFetcherType {
}
//OpenSea API output doesn't include the balance ("value") for each tokenId, it seems. So we have to fetch them:
let promises = contractsToTokenIds.map { contract, tokenIds in
Erc1155BalanceFetcher(address: account.address, server: server)
erc1155BalanceFetcher
.fetch(contract: contract, tokenIds: Set(tokenIds))
.map(on: queue, { (contract: contract, balances: $0) })
.recover(on: queue, { _ in return .value((contract: contract, balances: [:])) })

Loading…
Cancel
Save