Skip to content

Commit

Permalink
lightningd: rename 'satoshis' to 'amount' to avoid confusing check-so…
Browse files Browse the repository at this point in the history
…urce.

The type is enough (it's a struct amount_sat) to avoid confusion with
btc or msats.

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell committed Aug 9, 2019
1 parent 379079c commit 99236f8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lightningd/bitcoind.c
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ static void process_getfilteredblock_step2(struct bitcoind *bitcoind,
/* This is an interesting output, remember it. */
o = tal(call->outpoints, struct filteredblock_outpoint);
bitcoin_txid(tx, &o->txid);
o->satoshis = bitcoin_tx_output_get_amount(tx, j);
o->amount = bitcoin_tx_output_get_amount(tx, j);
o->txindex = i;
o->outnum = j;
o->scriptPubKey = tal_steal(o, script);
Expand Down
2 changes: 1 addition & 1 deletion lightningd/bitcoind.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ struct filteredblock_outpoint {
u32 outnum;
u32 txindex;
const u8 *scriptPubKey;
struct amount_sat satoshis;
struct amount_sat amount;
};

/* A struct representing a block with most of the parts filtered out. */
Expand Down
2 changes: 1 addition & 1 deletion lightningd/gossip_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ static void got_filteredblock(struct bitcoind *bitcoind,
}

if (fbo) {
txo.amount = fbo->satoshis;
txo.amount = fbo->amount;
txo.script = (u8 *)fbo->scriptPubKey;
got_txout(bitcoind, &txo, scid);
} else
Expand Down
2 changes: 1 addition & 1 deletion wallet/wallet.c
Original file line number Diff line number Diff line change
Expand Up @@ -2441,7 +2441,7 @@ void wallet_filteredblock_add(struct wallet *w, struct filteredblock *fb)
sqlite3_bind_int(stmt, 5, o->txindex);
sqlite3_bind_blob(stmt, 6, o->scriptPubKey,
tal_count(o->scriptPubKey), SQLITE_TRANSIENT);
sqlite3_bind_amount_sat(stmt, 7, o->satoshis);
sqlite3_bind_amount_sat(stmt, 7, o->amount);
db_exec_prepared(w->db, stmt);

outpointfilter_add(w->utxoset_outpoints, &o->txid, o->outnum);
Expand Down

0 comments on commit 99236f8

Please sign in to comment.