File tree Expand file tree Collapse file tree 4 files changed +7
-7
lines changed
Networking/Sources/Networking Expand file tree Collapse file tree 4 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -160,8 +160,8 @@ public final class Peer<Handler: StreamHandler>: Sendable {
160160 }
161161
162162 // there should be only one connection per peer
163- public func getPeersCount ( ) -> Int {
164- impl. connections. value . byId. values . count
163+ public var peersCount : Int {
164+ impl. connections. read { $0 . byId. count }
165165 }
166166}
167167
Original file line number Diff line number Diff line change @@ -84,8 +84,8 @@ public final class Network: Sendable {
8484 try peer. listenAddress ( )
8585 }
8686
87- public func getPeersCount ( ) -> Int {
88- peer. getPeersCount ( )
87+ public var peersCount : Int {
88+ peer. peersCount
8989 }
9090}
9191
Original file line number Diff line number Diff line change @@ -114,8 +114,8 @@ public final class NetworkManager: Sendable {
114114 }
115115 }
116116
117- public func getPeersCount ( ) -> Int {
118- network. getPeersCount ( )
117+ public var peersCount : Int {
118+ network. peersCount
119119 }
120120}
121121
Original file line number Diff line number Diff line change @@ -30,6 +30,6 @@ public final class NodeDataSource: DataSource {
3030 }
3131
3232 public func getPeersCount( ) async throws -> Int {
33- networkManager. getPeersCount ( )
33+ networkManager. peersCount
3434 }
3535}
You can’t perform that action at this time.
0 commit comments