Skip to content

Commit 3c4ed6f

Browse files
committed
Covered by Info::SuccessfulHandshake
1 parent 08e6b12 commit 3c4ed6f

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,6 @@ extension CbfClient {
4343
}
4444
}
4545

46-
if log.contains("Established an encrypted connection") && !isConnected {
47-
isConnected = true
48-
await MainActor.run {
49-
NotificationCenter.default.post(
50-
name: NSNotification.Name("KyotoConnectionUpdate"),
51-
object: nil,
52-
userInfo: ["connected": true]
53-
)
54-
}
55-
}
56-
5746
if log.contains("Need connections") && isConnected {
5847
isConnected = false
5948
await MainActor.run {
@@ -108,6 +97,17 @@ extension CbfClient {
10897
userInfo: ["connected": true]
10998
)
11099
}
100+
case .successfulHandshake:
101+
await MainActor.run {
102+
if !hasEstablishedConnection {
103+
hasEstablishedConnection = true
104+
NotificationCenter.default.post(
105+
name: NSNotification.Name("KyotoConnectionUpdate"),
106+
object: nil,
107+
userInfo: ["connected": true]
108+
)
109+
}
110+
}
111111
default:
112112
break
113113
}

0 commit comments

Comments
 (0)