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

Function wallet_datastore_first

wallet/wallet.c:5198–5223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5196}
5197
5198struct db_stmt *wallet_datastore_first(const tal_t *ctx,
5199 struct wallet *w,
5200 const char **startkey,
5201 const char ***key,
5202 const u8 **data,
5203 u64 *generation)
5204{
5205 struct db_stmt *stmt;
5206
5207 if (startkey) {
5208 stmt = db_prepare_v2(w->db,
5209 SQL("SELECT key, data, generation"
5210 " FROM datastore"
5211 " WHERE key >= ?"
5212 " ORDER BY key;"));
5213 db_bind_datastore_key(stmt, 0, startkey);
5214 } else {
5215 stmt = db_prepare_v2(w->db,
5216 SQL("SELECT key, data, generation"
5217 " FROM datastore"
5218 " ORDER BY key;"));
5219 }
5220 db_query_prepared(stmt);
5221
5222 return wallet_datastore_next(ctx, w, stmt, key, data, generation);
5223}
5224
5225struct db_stmt *wallet_datastore_next(const tal_t *ctx,
5226 struct wallet *w,

Callers 3

json_datastoreFunction · 0.85
json_listdatastoreFunction · 0.85
json_deldatastoreFunction · 0.85

Calls 3

db_bind_datastore_keyFunction · 0.85
db_query_preparedFunction · 0.85
wallet_datastore_nextFunction · 0.85

Tested by

no test coverage detected