@@ -19,21 +19,6 @@ extension CbfClient {
19
19
20
20
static func createComponents( wallet: Wallet ) -> ( client: CbfClient , node: CbfNode ) {
21
21
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
37
22
38
23
let components = try CbfBuilder ( )
39
24
. logLevel ( logLevel: . debug)
@@ -43,14 +28,8 @@ extension CbfClient {
43
28
. build ( wallet: wallet)
44
29
45
30
components. node. run ( )
46
- #if DEBUG
47
- print ( " [Kyoto] node started; peers= \( Constants . Networks. Signet. Regular. kyotoPeers. count) " )
48
- #endif
49
31
50
32
components. client. startBackgroundMonitoring ( )
51
- #if DEBUG
52
- print ( " [Kyoto] background monitoring started " )
53
- #endif
54
33
55
34
return ( client: components. client, node: components. node)
56
35
} catch {
@@ -70,9 +49,6 @@ extension CbfClient {
70
49
CbfClient . monitoringTasksQueue. sync { Self . lastInfoAt [ id] = Date ( ) }
71
50
switch info {
72
51
case let . progress( progress) :
73
- #if DEBUG
74
- print ( " [Kyoto] progress: \( progress) " )
75
- #endif
76
52
await MainActor . run {
77
53
NotificationCenter . default. post (
78
54
name: NSNotification . Name ( " KyotoProgressUpdate " ) ,
@@ -81,9 +57,6 @@ extension CbfClient {
81
57
)
82
58
}
83
59
case let . newChainHeight( height) :
84
- #if DEBUG
85
- print ( " [Kyoto] newChainHeight: \( height) " )
86
- #endif
87
60
await MainActor . run {
88
61
NotificationCenter . default. post (
89
62
name: NSNotification . Name ( " KyotoChainHeightUpdate " ) ,
@@ -100,9 +73,6 @@ extension CbfClient {
100
73
}
101
74
}
102
75
case . connectionsMet, . successfulHandshake:
103
- #if DEBUG
104
- print ( " [Kyoto] connections established " )
105
- #endif
106
76
await MainActor . run {
107
77
if !hasEstablishedConnection {
108
78
hasEstablishedConnection = true
@@ -139,11 +109,6 @@ extension CbfClient {
139
109
CbfClient . monitoringTasksQueue. sync {
140
110
if let last = Self . lastInfoAt [ id] { idleFor = Date ( ) . timeIntervalSince ( last) }
141
111
}
142
- #if DEBUG
143
- if idleFor >= 5 {
144
- print ( " [Kyoto] idle: waiting for info… \( Int ( idleFor) ) s " )
145
- }
146
- #endif
147
112
}
148
113
}
149
114
@@ -157,9 +122,6 @@ extension CbfClient {
157
122
if Task . isCancelled { break }
158
123
do {
159
124
let warning = try await self . nextWarning ( )
160
- #if DEBUG
161
- print ( " [Kyoto][warning] \( String ( describing: warning) ) " )
162
- #endif
163
125
if case . needConnections = warning {
164
126
await MainActor . run {
165
127
NotificationCenter . default. post (
@@ -186,13 +148,7 @@ extension CbfClient {
186
148
while true {
187
149
if Task . isCancelled { break }
188
150
do {
189
- #if DEBUG
190
- print ( " [Kyoto] calling nextLog() " )
191
- #endif
192
151
let log = try await self . nextLog ( )
193
- #if DEBUG
194
- print ( " [Kyoto] nextLog() returned: \( log) " )
195
- #endif
196
152
} catch is CancellationError {
197
153
break
198
154
} catch {
0 commit comments