mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-04-12 22:09:31 +02:00
Speeds up the filter for NWC zap payments.
This commit is contained in:
parent
255f464046
commit
388ccdbe75
@ -1188,7 +1188,7 @@ class Account(
|
||||
replyingToHex = event.id,
|
||||
authSigner = signer,
|
||||
)
|
||||
wcListener.start()
|
||||
wcListener.startSync()
|
||||
|
||||
LocalCache.consume(event, zappedNote) { it.response(signer) { onResponse(it) } }
|
||||
|
||||
|
@ -1664,7 +1664,10 @@ object LocalCache {
|
||||
@Suppress("UNUSED_PARAMETER")
|
||||
fun consume(event: ChannelMuteUserEvent) {}
|
||||
|
||||
fun consume(event: LnZapEvent) {
|
||||
fun consume(
|
||||
event: LnZapEvent,
|
||||
relay: Relay?,
|
||||
) {
|
||||
val note = getOrCreateNote(event.id)
|
||||
// Already processed this event.
|
||||
if (note.event != null) return
|
||||
@ -2693,7 +2696,7 @@ object LocalCache {
|
||||
event.zapRequest?.let {
|
||||
// must have a valid request
|
||||
verifyAndConsume(it, relay)
|
||||
consume(event)
|
||||
consume(event, relay)
|
||||
}
|
||||
}
|
||||
is LnZapRequestEvent -> consume(event)
|
||||
|
@ -157,6 +157,12 @@ abstract class NostrDataSource(
|
||||
resetFilters()
|
||||
}
|
||||
|
||||
open fun startSync() {
|
||||
Log.d("DataSource", "${this.javaClass.simpleName} Start")
|
||||
active = true
|
||||
resetFiltersSuspend()
|
||||
}
|
||||
|
||||
@OptIn(DelicateCoroutinesApi::class)
|
||||
open fun stop() {
|
||||
active = false
|
||||
|
Loading…
x
Reference in New Issue
Block a user