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

Function gather_utxos

wallet/wallet.c:470–488  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

468}
469
470static struct utxo **gather_utxos(const tal_t *ctx,
471 struct db_stmt *stmt STEALS)
472{
473 struct utxo **results;
474
475 db_query_prepared(stmt);
476 results = tal_arr(ctx, struct utxo *, 0);
477 while (db_step(stmt)) {
478 struct utxo *u = wallet_stmt2output(results, stmt);
479 tal_arr_expand(&results, u);
480 }
481 tal_free(stmt);
482
483 /* Make sure these are in order if we're trying to remove entropy */
484 if (randbytes_overridden())
485 asort(results, tal_count(results), cmp_utxo, NULL);
486
487 return results;
488}
489
490struct utxo **wallet_get_all_utxos(const tal_t *ctx, struct wallet *w)
491{

Callers 3

wallet_get_all_utxosFunction · 0.85
db_get_unspent_utxosFunction · 0.85

Calls 5

db_query_preparedFunction · 0.85
db_stepFunction · 0.85
wallet_stmt2outputFunction · 0.85
tal_freeFunction · 0.85
randbytes_overriddenFunction · 0.50

Tested by

no test coverage detected