nostrdb: relay-index: fix a few bugs

There were a few race conditions and lmdb bugs in the
relay index implementation. Fix those!

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2025-03-21 13:27:37 -07:00
committed by Daniel D’Aquino
parent c29027ff5b
commit f0521ba406
3 changed files with 19 additions and 8 deletions

View File

@@ -24,8 +24,10 @@ struct ndb_content_parser {
static int parse_digit(struct cursor *cur, int *digit) {
int c;
if ((c = peek_char(cur, 0)) == -1)
if ((c = peek_char(cur, 0)) == -1) {
*digit = 0;
return 0;
}
c -= '0';