nostrdb/blocks: expose block iterator internals

so we don't need heap allocation. we will be calling this a lot in tight
render loops, we don't want to be allocating on each frame.

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2023-12-30 19:19:15 -08:00
committed by Daniel D’Aquino
parent d063362bd7
commit c677233dcb
5 changed files with 50 additions and 56 deletions

View File

@@ -4,18 +4,10 @@
#include <inttypes.h>
#include "cursor.h"
#include "nostrdb.h"
struct bolt11;
struct ndb_invoice {
unsigned char version;
uint64_t amount;
uint64_t timestamp;
uint64_t expiry;
char *description;
unsigned char *description_hash;
};
// ENCODING
int ndb_encode_invoice(struct cursor *cur, struct bolt11 *invoice);
int ndb_decode_invoice(struct cursor *cur, struct ndb_invoice *invoice);