Load zaps instantly on events

Refactor our event cache a bit and add zap caching

Changelog-Changed: Load zaps instantly on events
This commit is contained in:
William Casarin
2023-04-28 17:22:53 -07:00
parent c2325a5e39
commit be08083b88
6 changed files with 67 additions and 29 deletions

View File

@@ -31,6 +31,14 @@ struct DamusState {
let replies: ReplyCounter
let muted_threads: MutedThreadsManager
@discardableResult
func add_zap(zap: Zap) -> Bool {
// store generic zap mapping
self.zaps.add_zap(zap: zap)
// associate with events as well
return self.events.store_zap(zap: zap)
}
var pubkey: String {
return keypair.pubkey
}