Browse Source

lightningd: rename 'satoshis' to 'amount' to avoid confusing check-source.

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

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
pull/2938/head
Rusty Russell 5 years ago
parent
commit
99236f86f9
  1. 2
      lightningd/bitcoind.c
  2. 2
      lightningd/bitcoind.h
  3. 2
      lightningd/gossip_control.c
  4. 2
      wallet/wallet.c

2
lightningd/bitcoind.c

@ -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);

2
lightningd/bitcoind.h

@ -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. */

2
lightningd/gossip_control.c

@ -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

2
wallet/wallet.c

@ -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);

Loading…
Cancel
Save