Updated on 2026-08-14

This commit is contained in:
Tangem 2026-05-29 18:15:17 +04:00
parent fdc9bdbdae
commit b3d51d6805

View file

@ -17,13 +17,13 @@ internal class DefaultYieldModuleAddressProvider(
private val dispatchers: CoroutineDispatcherProvider,
) : YieldModuleAddressProvider {
private data class Key(val userWalletId: UserWalletId, val networkRawId: String)
private data class Key(val userWalletId: UserWalletId, val networkId: Network.ID)
private val cache = ConcurrentHashMap<Key, String>()
private val mutex = Mutex()
override suspend fun getOrFetch(userWalletId: UserWalletId, network: Network): String? {
val key = Key(userWalletId, network.rawId)
val key = Key(userWalletId, network.id)
cache[key]?.let { return it }
return withContext(dispatchers.io) {
mutex.withLock {