Skip to content

Commit 286c39b

Browse files
committed
misc: remove print
1 parent e31d484 commit 286c39b

File tree

3 files changed

+0
-66
lines changed

3 files changed

+0
-66
lines changed

BDKSwiftExampleWallet/Extensions/BDK+Extensions/CbfClient+Extensions.swift

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,6 @@ extension CbfClient {
1919

2020
static func createComponents(wallet: Wallet) -> (client: CbfClient, node: CbfNode) {
2121
do {
22-
#if DEBUG
23-
let dataDirPath = Constants.Config.Kyoto.dbPath
24-
print("[Kyoto] dataDir: \(dataDirPath)")
25-
do {
26-
let testFile = (dataDirPath as NSString).appendingPathComponent(".write_test")
27-
try Data("ok".utf8).write(to: URL(fileURLWithPath: testFile))
28-
try? FileManager.default.removeItem(atPath: testFile)
29-
print("[Kyoto] dataDir writable: true")
30-
} catch {
31-
print("[Kyoto] dataDir writable: false error=\(error)")
32-
}
33-
let peers = Constants.Networks.Signet.Regular.kyotoPeers
34-
print("[Kyoto] peers count: \(peers.count)")
35-
for peer in peers { print("[Kyoto] peer: \(peer)") }
36-
#endif
3722

3823
let components = try CbfBuilder()
3924
.logLevel(logLevel: .debug)
@@ -43,14 +28,8 @@ extension CbfClient {
4328
.build(wallet: wallet)
4429

4530
components.node.run()
46-
#if DEBUG
47-
print("[Kyoto] node started; peers=\(Constants.Networks.Signet.Regular.kyotoPeers.count)")
48-
#endif
4931

5032
components.client.startBackgroundMonitoring()
51-
#if DEBUG
52-
print("[Kyoto] background monitoring started")
53-
#endif
5433

5534
return (client: components.client, node: components.node)
5635
} catch {
@@ -70,9 +49,6 @@ extension CbfClient {
7049
CbfClient.monitoringTasksQueue.sync { Self.lastInfoAt[id] = Date() }
7150
switch info {
7251
case let .progress(progress):
73-
#if DEBUG
74-
print("[Kyoto] progress: \(progress)")
75-
#endif
7652
await MainActor.run {
7753
NotificationCenter.default.post(
7854
name: NSNotification.Name("KyotoProgressUpdate"),
@@ -81,9 +57,6 @@ extension CbfClient {
8157
)
8258
}
8359
case let .newChainHeight(height):
84-
#if DEBUG
85-
print("[Kyoto] newChainHeight: \(height)")
86-
#endif
8760
await MainActor.run {
8861
NotificationCenter.default.post(
8962
name: NSNotification.Name("KyotoChainHeightUpdate"),
@@ -100,9 +73,6 @@ extension CbfClient {
10073
}
10174
}
10275
case .connectionsMet, .successfulHandshake:
103-
#if DEBUG
104-
print("[Kyoto] connections established")
105-
#endif
10676
await MainActor.run {
10777
if !hasEstablishedConnection {
10878
hasEstablishedConnection = true
@@ -139,11 +109,6 @@ extension CbfClient {
139109
CbfClient.monitoringTasksQueue.sync {
140110
if let last = Self.lastInfoAt[id] { idleFor = Date().timeIntervalSince(last) }
141111
}
142-
#if DEBUG
143-
if idleFor >= 5 {
144-
print("[Kyoto] idle: waiting for info… \(Int(idleFor))s")
145-
}
146-
#endif
147112
}
148113
}
149114

@@ -157,9 +122,6 @@ extension CbfClient {
157122
if Task.isCancelled { break }
158123
do {
159124
let warning = try await self.nextWarning()
160-
#if DEBUG
161-
print("[Kyoto][warning] \(String(describing: warning))")
162-
#endif
163125
if case .needConnections = warning {
164126
await MainActor.run {
165127
NotificationCenter.default.post(
@@ -186,13 +148,7 @@ extension CbfClient {
186148
while true {
187149
if Task.isCancelled { break }
188150
do {
189-
#if DEBUG
190-
print("[Kyoto] calling nextLog()")
191-
#endif
192151
let log = try await self.nextLog()
193-
#if DEBUG
194-
print("[Kyoto] nextLog() returned: \(log)")
195-
#endif
196152
} catch is CancellationError {
197153
break
198154
} catch {

BDKSwiftExampleWallet/Service/BDK Service/BDKService.swift

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -63,24 +63,12 @@ extension BlockchainClient {
6363
return Self(
6464
sync: { request, _ in
6565
let components = try getOrCreateComponents()
66-
#if DEBUG
67-
print("[Kyoto][BDKService] calling update() (sync)")
68-
#endif
6966
let upd = try await components.client.update()
70-
#if DEBUG
71-
print("[Kyoto][BDKService] update() returned (sync)")
72-
#endif
7367
return upd
7468
},
7569
fullScan: { request, stopGap, _ in
7670
let components = try getOrCreateComponents()
77-
#if DEBUG
78-
print("[Kyoto][BDKService] calling update() (fullScan)")
79-
#endif
8071
let upd = try await components.client.update()
81-
#if DEBUG
82-
print("[Kyoto][BDKService] update() returned (fullScan)")
83-
#endif
8472
return upd
8573
},
8674
broadcast: { tx in
@@ -169,9 +157,6 @@ private class BDKService {
169157
self.blockchainURL.isEmpty
170158
? Constants.Config.Kyoto.getDefaultPeer(for: self.network)
171159
: self.blockchainURL
172-
#if DEBUG
173-
print("[BDKService] selecting Kyoto peer=\(peer)")
174-
#endif
175160
self.blockchainClient = .kyoto(peer: peer)
176161
}
177162
case .electrum:

BDKSwiftExampleWallet/View Model/WalletViewModel.swift

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,6 @@ class WalletViewModel {
5757
self?.inspectedScripts = inspected
5858
let fraction = total > 0 ? Float(inspected) / Float(total) : 0
5959
self?.progress = fraction
60-
#if DEBUG
61-
let percent = Int((fraction * 100).rounded())
62-
print("[Esplora][VM] inspected=\(inspected)/\(total) fraction=\(String(format: "%.4f", fraction)) percent=\(percent)%")
63-
#endif
6460
}
6561
}
6662
}
@@ -72,9 +68,6 @@ class WalletViewModel {
7268
let progressPercent = UInt64(progress)
7369
self?.inspectedScripts = progressPercent
7470
self?.totalScripts = 100
75-
#if DEBUG
76-
print("[Kyoto][VM] percent=\(Int(progress))%")
77-
#endif
7871
}
7972
}
8073
}

0 commit comments

Comments
 (0)