ndb/note: always track note size, add to_owned

This commit is contained in:
William Casarin
2023-12-03 22:12:31 -08:00
parent 59cde41764
commit 9c3b052de2
4 changed files with 24 additions and 10 deletions

View File

@@ -84,7 +84,7 @@ enum NostrResponse {
return nil
}
let new_note = note_data.assumingMemoryBound(to: ndb_note.self)
let note = NdbNote(note: new_note, owned_size: Int(len), key: nil)
let note = NdbNote(note: new_note, size: Int(len), owned: true, key: nil)
guard let subid = sized_cstr(cstr: tce.subid, len: tce.subid_len) else {
free(data)