nostrdb/blocks: add total_size

Fix this mistake that we have with ndb_notes where we don't know the
total size of the object

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2023-12-30 06:29:24 -08:00
committed by Daniel D’Aquino
parent c2c73c3af6
commit c831976078
4 changed files with 15 additions and 5 deletions

View File

@@ -196,3 +196,8 @@ uint32_t ndb_str_block_len(struct ndb_str_block *str_block) {
struct nostr_bech32 *ndb_bech32_block(struct ndb_block *block) {
return &block->block.mention_bech32.bech32;
}
// total size including padding
size_t ndb_blocks_total_size(struct ndb_blocks *blocks) {
return blocks->total_size;
}