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), stats = RelayStats.get(relay),
scope = scope, scope = scope,
) { liveRelay -> ) { liveRelay ->
activeRequests.forEachSub(relay, liveRelay::sendRequest) if (isActive) {
activeCounts.forEachSub(relay, liveRelay::sendCount) activeRequests.forEachSub(relay, liveRelay::sendRequest)
eventOutbox.forEachUnsentEvent(relay, liveRelay::send) activeCounts.forEachSub(relay, liveRelay::sendCount)
eventOutbox.forEachUnsentEvent(relay, liveRelay::send)
}
} }
fun allAvailableRelays() = relayPool.getAll() fun allAvailableRelays() = relayPool.getAll()