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

Function wallet_list_addresses

wallet/wallet.c:6836–6856  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6834}
6835
6836struct issued_address_type *wallet_list_addresses(const tal_t *ctx, struct wallet *wallet,
6837 u64 liststart, const u32 *listlimit)
6838{
6839 struct db_stmt *stmt;
6840 struct issued_address_type *addresseslist = tal_arr(ctx, struct issued_address_type, 0);
6841 stmt = db_prepare_v2(wallet->db, SQL("SELECT keyidx, addrtype FROM addresses WHERE keyidx >= ? ORDER BY keyidx LIMIT ?;"));
6842 db_bind_u64(stmt, liststart);
6843 if (listlimit)
6844 db_bind_int(stmt, *listlimit);
6845 else
6846 db_bind_int(stmt, INT_MAX);
6847 db_query_prepared(stmt);
6848 while(db_step(stmt)) {
6849 struct issued_address_type a;
6850 a.keyidx = db_col_u64(stmt, "keyidx");
6851 a.addrtype = wallet_addrtype_in_db(db_col_int(stmt, "addrtype"));
6852 tal_arr_expand(&addresseslist, a);
6853 }
6854 tal_free(stmt);
6855 return addresseslist;
6856}
6857
6858void db_bind_credit_debit(struct db_stmt *stmt,
6859 struct amount_msat credit,

Callers 1

json_listaddressesFunction · 0.85

Calls 8

db_bind_u64Function · 0.85
db_bind_intFunction · 0.85
db_query_preparedFunction · 0.85
db_stepFunction · 0.85
db_col_u64Function · 0.85
wallet_addrtype_in_dbFunction · 0.85
db_col_intFunction · 0.85
tal_freeFunction · 0.85

Tested by

no test coverage detected