| 468 | } |
| 469 | |
| 470 | static 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 | |
| 490 | struct utxo **wallet_get_all_utxos(const tal_t *ctx, struct wallet *w) |
| 491 | { |
no test coverage detected