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

Function db_col_node_id_arr

db/bindings.c:336–351  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

334}
335
336struct node_id *db_col_node_id_arr(const tal_t *ctx, struct db_stmt *stmt,
337 const char *colname)
338{
339 size_t col = db_query_colnum(stmt, colname);
340 struct node_id *ret;
341 size_t n = db_column_bytes(stmt, col) / sizeof(ret->k);
342 const u8 *arr = db_column_blob(stmt, col);
343 assert(n * sizeof(ret->k) == (size_t)db_column_bytes(stmt, col));
344 ret = tal_arr(ctx, struct node_id, n);
345
346 db_column_null_warn(stmt, colname, col);
347 for (size_t i = 0; i < n; i++)
348 memcpy(ret[i].k, arr + i * sizeof(ret[i].k), sizeof(ret[i].k));
349
350 return ret;
351}
352
353void db_col_pubkey(struct db_stmt *stmt,
354 const char *colname,

Callers 1

wallet_stmt2paymentFunction · 0.85

Calls 4

db_query_colnumFunction · 0.85
db_column_bytesFunction · 0.85
db_column_blobFunction · 0.85
db_column_null_warnFunction · 0.85

Tested by

no test coverage detected