MCPcopy Create free account
hub / github.com/ElementsProject/lightning / db_col_datastore_key

Function db_col_datastore_key

wallet/datastore.c:83–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81}
82
83static const char **db_col_datastore_key(const tal_t *ctx,
84 struct db_stmt *stmt,
85 const char *colname)
86{
87 char **key;
88 const u8 *joined = db_col_blob(stmt, colname);
89 size_t len = db_col_bytes(stmt, colname);
90
91 key = tal_arr(ctx, char *, 0);
92 do {
93 size_t partlen;
94 for (partlen = 0; partlen < len; partlen++) {
95 if (joined[partlen] == '\0') {
96 partlen++;
97 break;
98 }
99 }
100 tal_arr_expand(&key, tal_strndup(key, (char *)joined, partlen));
101 len -= partlen;
102 joined += partlen;
103 } while (len != 0);
104
105 return cast_const2(const char **, key);
106}
107
108struct db_stmt *db_datastore_next(const tal_t *ctx,
109 struct db_stmt *stmt,

Callers 1

db_datastore_nextFunction · 0.85

Calls 2

db_col_blobFunction · 0.85
db_col_bytesFunction · 0.85

Tested by

no test coverage detected