File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed
app/src/main/java/to/bitkit Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -28,17 +28,13 @@ class VssStoreIdProvider @Inject constructor(
2828 passphrase = passphrase,
2929 )
3030
31- Logger .info(" VSS store id: '$storeId ' for walletIndex: $walletIndex " , context = TAG )
3231 cachedStoreIds[walletIndex] = storeId
32+ Logger .info(" VSS store id setup for wallet[$walletIndex ]: '$storeId '" , context = TAG )
3333 return storeId
3434 }
3535 }
3636
37- fun clearCache () {
38- cachedStoreIds.clear()
39- }
40-
41- fun clearCache (walletIndex : Int ) {
37+ fun clearCache (walletIndex : Int = 0) {
4238 cachedStoreIds.remove(walletIndex)
4339 }
4440
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ import org.lightningdevkit.ldknode.Event
1818import to.bitkit.data.AppDb
1919import to.bitkit.data.CacheStore
2020import to.bitkit.data.SettingsStore
21+ import to.bitkit.data.backup.VssStoreIdProvider
2122import to.bitkit.data.entities.TagMetadataEntity
2223import to.bitkit.data.keychain.Keychain
2324import to.bitkit.di.BgDispatcher
@@ -50,6 +51,7 @@ class WalletRepo @Inject constructor(
5051 private val lightningRepo : LightningRepo ,
5152 private val cacheStore : CacheStore ,
5253 private val deriveBalanceStateUseCase : DeriveBalanceStateUseCase ,
54+ private val vssStoreIdProvider : VssStoreIdProvider ,
5355) {
5456 private val repoScope = CoroutineScope (bgDispatcher + SupervisorJob ())
5557
@@ -210,6 +212,7 @@ class WalletRepo @Inject constructor(
210212 suspend fun wipeWallet (walletIndex : Int = 0): Result <Unit > = withContext(bgDispatcher) {
211213 try {
212214 keychain.wipe()
215+ vssStoreIdProvider.clearCache(walletIndex)
213216 db.clearAllTables()
214217 settingsStore.reset()
215218 cacheStore.reset()
You can’t perform that action at this time.
0 commit comments