File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
app/src/main/java/to/bitkit/data/backup Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -5,14 +5,15 @@ import to.bitkit.data.keychain.Keychain
55import to.bitkit.env.Env
66import to.bitkit.utils.Logger
77import to.bitkit.utils.ServiceError
8+ import java.util.concurrent.ConcurrentHashMap
89import javax.inject.Inject
910import javax.inject.Singleton
1011
1112@Singleton
1213class VssStoreIdProvider @Inject constructor(
1314 private val keychain : Keychain ,
1415) {
15- private val cachedStoreIds: MutableMap <Int , String > = mutableMapOf ()
16+ private val cachedStoreIds: MutableMap <Int , String > = ConcurrentHashMap ()
1617
1718 fun getVssStoreId (walletIndex : Int = 0): String {
1819 synchronized(this ) {
@@ -34,15 +35,11 @@ class VssStoreIdProvider @Inject constructor(
3435 }
3536
3637 fun clearCache () {
37- synchronized(this ) {
38- cachedStoreIds.clear()
39- }
38+ cachedStoreIds.clear()
4039 }
4140
4241 fun clearCache (walletIndex : Int ) {
43- synchronized(this ) {
44- cachedStoreIds.remove(walletIndex)
45- }
42+ cachedStoreIds.remove(walletIndex)
4643 }
4744
4845 companion object {
You can’t perform that action at this time.
0 commit comments