mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-28 20:33:17 +02:00
Avoids adding local relays to the hint index.
This commit is contained in:
@@ -24,6 +24,7 @@ import com.vitorpamplona.quartz.nip01Core.core.HexKey
|
||||
import com.vitorpamplona.quartz.nip01Core.core.hexToByteArray
|
||||
import com.vitorpamplona.quartz.nip01Core.hints.bloom.BloomFilterMurMur3
|
||||
import com.vitorpamplona.quartz.nip01Core.relay.normalizer.NormalizedRelayUrl
|
||||
import com.vitorpamplona.quartz.nip01Core.relay.normalizer.isLocalHost
|
||||
import com.vitorpamplona.quartz.utils.LargeCache
|
||||
|
||||
/**
|
||||
@@ -43,8 +44,10 @@ class HintIndexer {
|
||||
relay: NormalizedRelayUrl,
|
||||
bloom: BloomFilterMurMur3,
|
||||
) {
|
||||
relayDB.put(relay, relay)
|
||||
bloom.add(id, relay.hashCode())
|
||||
if (!relay.isLocalHost()) {
|
||||
relayDB.put(relay, relay)
|
||||
bloom.add(id, relay.hashCode())
|
||||
}
|
||||
}
|
||||
|
||||
private fun getHintsFor(
|
||||
|
Reference in New Issue
Block a user