Avoids sending filters on new connections if the client is not active

This commit is contained in:
Vitor Pamplona
2025-07-30 18:23:02 -04:00
parent 5d4b16641e
commit 2e9696745a
@@ -115,9 +115,11 @@ class NostrClient(
stats = RelayStats.get(relay),
scope = scope,
) { liveRelay ->
activeRequests.forEachSub(relay, liveRelay::sendRequest)
activeCounts.forEachSub(relay, liveRelay::sendCount)
eventOutbox.forEachUnsentEvent(relay, liveRelay::send)
if (isActive) {
activeRequests.forEachSub(relay, liveRelay::sendRequest)
activeCounts.forEachSub(relay, liveRelay::sendCount)
eventOutbox.forEachUnsentEvent(relay, liveRelay::send)
}
}
fun allAvailableRelays() = relayPool.getAll()