File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
BDKSwiftExampleWallet/Service/BDK Service Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,11 @@ private class BDKService {
35
35
guard let wallet = self . wallet else {
36
36
throw WalletError . walletNotFound
37
37
}
38
+ guard let connection = self . connection else {
39
+ throw WalletError . dbNotFound
40
+ }
38
41
let addressInfo = wallet. revealNextAddress ( keychain: . external)
42
+ let _ = try wallet. persist ( connection: connection)
39
43
return addressInfo. address. description
40
44
}
41
45
@@ -213,6 +217,10 @@ private class BDKService {
213
217
parallelRequests: UInt64 ( 5 )
214
218
)
215
219
let _ = try wallet. applyUpdate ( update: update)
220
+ guard let connection = self . connection else {
221
+ throw WalletError . dbNotFound
222
+ }
223
+ let _ = try wallet. persist ( connection: connection)
216
224
}
217
225
218
226
func fullScanWithInspector( inspector: FullScanScriptInspector ) async throws {
@@ -227,6 +235,10 @@ private class BDKService {
227
235
parallelRequests: UInt64 ( 5 ) // should we default value this for folks?
228
236
)
229
237
let _ = try wallet. applyUpdate ( update: update)
238
+ guard let connection = self . connection else {
239
+ throw WalletError . dbNotFound
240
+ }
241
+ let _ = try wallet. persist ( connection: connection)
230
242
}
231
243
232
244
func calculateFee( tx: Transaction ) throws -> Amount {
You can’t perform that action at this time.
0 commit comments