Skip to content

Commit 2caebd1

Browse files
committed
fix: try catch
1 parent 3933e6a commit 2caebd1

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

app/src/main/java/com/github/jvsena42/floresta/domain/bitcoin/WalletManager.kt

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -186,14 +186,18 @@ class WalletManager(
186186
fullScan()
187187
} else {
188188
Log.d(TAG, "sync: normal sync")
189-
val syncRequest = wallet.startSyncWithRevealedSpks().build()
190-
val update = blockchainClient.sync(
191-
syncRequest = syncRequest,
192-
batchSize = 100u,
193-
fetchPrevTxouts = true
194-
)
195-
wallet.applyUpdate(update)
196-
wallet.persist(dbConnection)
189+
try {
190+
val syncRequest = wallet.startSyncWithRevealedSpks().build()
191+
val update = blockchainClient.sync(
192+
syncRequest = syncRequest,
193+
batchSize = 100u,
194+
fetchPrevTxouts = true
195+
)
196+
wallet.applyUpdate(update)
197+
wallet.persist(dbConnection)
198+
} catch (e: Exception) {
199+
Log.e(TAG, "sync error: ", e)
200+
}
197201
}
198202
}
199203

0 commit comments

Comments
 (0)