nostrdb

an unfairly fast embedded nostr database backed by lmdb
git clone git://jb55.com/nostrdb
Log | Files | Refs | Submodules | README | LICENSE

commit 4d0f1426cc4163b672d6abe35cf9e732c3255118
parent 9eb823a2b3d0cb723ebcc7d64dafddbf6ec0feb8
Author: William Casarin <jb55@jb55.com>
Date:   Thu, 23 Nov 2023 13:18:17 -0800

debug: use mdb_strerror in more places

instead of codes

Diffstat:
Mnostrdb.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/nostrdb.c b/nostrdb.c @@ -2170,13 +2170,13 @@ static int ndb_init_lmdb(const char *filename, struct ndb_lmdb *lmdb, size_t map // index dbs if ((rc = mdb_dbi_open(txn, "note_id", tsid_flags, &lmdb->dbs[NDB_DB_NOTE_ID]))) { - fprintf(stderr, "mdb_dbi_open id failed, error %d\n", rc); + fprintf(stderr, "mdb_dbi_open id failed: %s\n", mdb_strerror(rc)); return 0; } mdb_set_compare(txn, lmdb->dbs[NDB_DB_NOTE_ID], ndb_tsid_compare); if ((rc = mdb_dbi_open(txn, "profile_pk", tsid_flags, &lmdb->dbs[NDB_DB_PROFILE_PK]))) { - fprintf(stderr, "mdb_dbi_open id failed, error %d\n", rc); + fprintf(stderr, "mdb_dbi_open id failed: %s\n", mdb_strerror(rc)); return 0; } mdb_set_compare(txn, lmdb->dbs[NDB_DB_PROFILE_PK], ndb_tsid_compare);