Skip to content

Commit

Permalink
wallet/wallet.c: don't declare unused variable.
Browse files Browse the repository at this point in the history
Ubuntu clang 15.0.2-1 complains:

```
wallet/wallet.c:280:6: error: variable 'i' set but not used
      [-Werror,-Wunused-but-set-variable]
        int i;
            ^
wallet/wallet.c:339:6: error: variable 'i' set but not used
      [-Werror,-Wunused-but-set-variable]
        int i;
            ^
wallet/wallet.c:4768:9: error: variable 'count' set but not used
      [-Werror,-Wunused-but-set-variable]
        size_t count;
               ^
```

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell authored and cdecker committed Nov 18, 2022
1 parent 5e76c74 commit d94b715
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions wallet/wallet.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,6 @@ bool wallet_update_output_status(struct wallet *w,
struct utxo **wallet_get_utxos(const tal_t *ctx, struct wallet *w, const enum output_status state)
{
struct utxo **results;
int i;
struct db_stmt *stmt;

if (state == OUTPUT_STATE_ANY) {
Expand Down Expand Up @@ -329,7 +328,7 @@ struct utxo **wallet_get_utxos(const tal_t *ctx, struct wallet *w, const enum ou
db_query_prepared(stmt);

results = tal_arr(ctx, struct utxo*, 0);
for (i=0; db_step(stmt); i++) {
while (db_step(stmt)) {
struct utxo *u = wallet_stmt2output(results, stmt);
tal_arr_expand(&results, u);
}
Expand All @@ -343,7 +342,6 @@ struct utxo **wallet_get_unconfirmed_closeinfo_utxos(const tal_t *ctx,
{
struct db_stmt *stmt;
struct utxo **results;
int i;

stmt = db_prepare_v2(w->db, SQL("SELECT"
" prev_out_tx"
Expand All @@ -368,7 +366,7 @@ struct utxo **wallet_get_unconfirmed_closeinfo_utxos(const tal_t *ctx,
db_query_prepared(stmt);

results = tal_arr(ctx, struct utxo *, 0);
for (i = 0; db_step(stmt); i++) {
while (db_step(stmt)) {
struct utxo *u = wallet_stmt2output(results, stmt);
tal_arr_expand(&results, u);
}
Expand Down Expand Up @@ -4783,7 +4781,6 @@ bool wallet_forward_delete(struct wallet *w,
struct wallet_transaction *wallet_transactions_get(struct wallet *w, const tal_t *ctx)
{
struct db_stmt *stmt;
size_t count;
struct wallet_transaction *cur = NULL, *txs = tal_arr(ctx, struct wallet_transaction, 0);
struct bitcoin_txid last;

Expand Down Expand Up @@ -4811,7 +4808,7 @@ struct wallet_transaction *wallet_transactions_get(struct wallet *w, const tal_t
"ORDER BY t.blockheight, t.txindex ASC"));
db_query_prepared(stmt);

for (count = 0; db_step(stmt); count++) {
while (db_step(stmt)) {
struct bitcoin_txid curtxid;
db_col_txid(stmt, "t.id", &curtxid);

Expand Down

0 comments on commit d94b715

Please sign in to comment.