nostrdb/blocks: add note block iterator

This adds an api that walks along and pulls compact note block data out of
nostrdb.

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2023-12-28 13:54:22 -08:00
committed by Daniel D’Aquino
parent 6f9bd6c4f4
commit 034f2cc02f
8 changed files with 247 additions and 152 deletions

View File

@@ -8,6 +8,8 @@
#include "nostr_bech32.h"
#include <stdlib.h>
#include "cursor.h"
#include "str_block.h"
#include "nostrdb.h"
#include "bolt11/bech32.h"
#define MAX_TLVS 32
@@ -88,7 +90,7 @@ static int parse_nostr_bech32_nsec(struct cursor *cur, struct bech32_nsec *nsec)
static int add_relay(struct relays *relays, struct nostr_tlv *tlv)
{
struct str_block *str;
struct ndb_str_block *str;
if (relays->num_relays + 1 > MAX_RELAYS)
return 0;