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

Function list_accounts

plugins/bkpr/recorder.c:1193–1220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1191}
1192
1193struct account **list_accounts(const tal_t *ctx, struct db *db)
1194{
1195 struct db_stmt *stmt;
1196 struct account **results;
1197
1198 stmt = db_prepare_v2(db, SQL("SELECT"
1199 " id"
1200 ", name"
1201 ", peer_id"
1202 ", opened_event_id"
1203 ", closed_event_id"
1204 ", onchain_resolved_block"
1205 ", is_wallet"
1206 ", we_opened"
1207 ", leased"
1208 ", closed_count"
1209 " FROM accounts;"));
1210 db_query_prepared(stmt);
1211
1212 results = tal_arr(ctx, struct account *, 0);
1213 while (db_step(stmt)) {
1214 struct account *a = stmt2account(results, stmt);
1215 tal_arr_expand(&results, a);
1216 }
1217 tal_free(stmt);
1218
1219 return results;
1220}
1221
1222void account_add(struct db *db, struct account *acct)
1223{

Callers 4

json_list_balancesFunction · 0.85
list_income_eventsFunction · 0.85
compute_channel_apysFunction · 0.85
test_account_crudFunction · 0.85

Calls 4

db_query_preparedFunction · 0.85
db_stepFunction · 0.85
stmt2accountFunction · 0.85
tal_freeFunction · 0.85

Tested by 1

test_account_crudFunction · 0.68