Skip to content

Commit 93562f2

Browse files
committed
organize code
1 parent db1a908 commit 93562f2

File tree

1 file changed

+4
-21
lines changed

1 file changed

+4
-21
lines changed

BDKSwiftExampleWallet/Service/BDKSyncService/KyotoService.swift

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Foundation
1010

1111
final class KyotoService: BDKSyncService {
1212

13-
private static let nodeHeight: UInt32 = 253_000
13+
private static let nodeHeight: UInt32 = 300_000
1414

1515
static let shared = KyotoService()
1616

@@ -23,7 +23,7 @@ final class KyotoService: BDKSyncService {
2323
private var node: CbfNode?
2424
private var connected = false
2525

26-
private var fullScanProgress2: FullScanProgress?
26+
private var fullScanProgress: FullScanProgress?
2727
private var syncProgress: SyncScanProgress?
2828

2929
init(
@@ -67,7 +67,7 @@ final class KyotoService: BDKSyncService {
6767
let nodeComponents = try buildNode(
6868
from: wallet, scanType: .recovery(fromHeight: KyotoService.nodeHeight)
6969
)
70-
self.fullScanProgress2 = progress
70+
self.fullScanProgress = progress
7171
self.client = nodeComponents.client
7272
self.node = nodeComponents.node
7373
try await startListen()
@@ -108,20 +108,6 @@ final class KyotoService: BDKSyncService {
108108
return true
109109
}
110110

111-
// private func continuallyUpdate() async {
112-
// Task {
113-
// while true {
114-
// guard let update = await self.client?.update() else { return }
115-
// try self.wallet?.applyUpdate(update: update)
116-
// let _ = try self.wallet?.persist(connection: self.connection ?? Connection.loadConnection())
117-
// print("######### walletUpdated")
118-
//// DispatchQueue.main.async {
119-
//// NotificationCenter.default.post(name: .walletUpdated, object: nil)
120-
//// }
121-
// }
122-
// }
123-
// }
124-
125111
private func printLogs() {
126112
Task {
127113
while true {
@@ -132,7 +118,7 @@ final class KyotoService: BDKSyncService {
132118
print("######### connected")
133119
self.connected = true
134120
case .progress(let progress):
135-
if let fullScanProgress = self.fullScanProgress2 {
121+
if let fullScanProgress = self.fullScanProgress {
136122
let _progress = UInt64(progress * 100.0)
137123
fullScanProgress(_progress)
138124
}
@@ -152,9 +138,6 @@ final class KyotoService: BDKSyncService {
152138
case .needConnections:
153139
print("######### disconnected")
154140
self.connected = false
155-
// DispatchQueue.main.async {
156-
// NotificationCenter.default.post(name: .connectionsChanged, object: nil)
157-
// }
158141
default:
159142
#if DEBUG
160143
print(warn)

0 commit comments

Comments
 (0)