From 2bc893982af6b69b7147bff1818b50d8d75ce398 Mon Sep 17 00:00:00 2001 From: Morgan Pretty Date: Tue, 8 Oct 2024 09:50:51 +1100 Subject: [PATCH] Added a function to retrieve the snode cache size from libSession --- LibSession-Util | 2 +- SessionSnodeKit/LibSession/LibSession+Networking.swift | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/LibSession-Util b/LibSession-Util index f19df114e..10f15aeb1 160000 --- a/LibSession-Util +++ b/LibSession-Util @@ -1 +1 @@ -Subproject commit f19df114e5f4f6c29112f49c0b4897d7b93b78f1 +Subproject commit 10f15aeb1f9712452adf55a8d0826be6271c10e4 diff --git a/SessionSnodeKit/LibSession/LibSession+Networking.swift b/SessionSnodeKit/LibSession/LibSession+Networking.swift index 162f9abd3..a5c16f242 100644 --- a/SessionSnodeKit/LibSession/LibSession+Networking.swift +++ b/SessionSnodeKit/LibSession/LibSession+Networking.swift @@ -167,6 +167,12 @@ public extension LibSession { network_clear_cache(network) } + static func snodeCacheSize() -> Int { + guard let network: UnsafeMutablePointer = networkCache.wrappedValue else { return 0 } + + return network_get_snode_cache_size(network) + } + static func getSwarm(swarmPublicKey: String) -> AnyPublisher, Error> { typealias Output = Result, Error>