blocks: pass keypair instead of privkey to avoid pubkey gen

Generating a pubkey is quite slow, so pass a keypair instead of privkey
This commit is contained in:
William Casarin
2023-08-28 11:46:03 -07:00
parent 8e92e28faf
commit c71b0ee916
24 changed files with 108 additions and 107 deletions

View File

@@ -11,9 +11,9 @@ enum NoteContent {
case note(NostrEvent)
case content(String, TagsSequence?)
init(note: NostrEvent, privkey: Privkey?) {
init(note: NostrEvent, keypair: Keypair) {
if note.known_kind == .dm {
self = .content(note.get_content(privkey), note.tags)
self = .content(note.get_content(keypair), note.tags)
} else {
self = .note(note)
}