Browse Source

bitcoin/tx.c: `bitcoin_tx_output_get_amount_sat` now accepts `const` transactions.

It is a getter, so, does not change the transaction, so should accept `const`.
bump-pyln-proto
ZmnSCPxj jxPCSnmZ 4 years ago
committed by Rusty Russell
parent
commit
12c9b27838
  1. 2
      bitcoin/tx.c
  2. 2
      bitcoin/tx.h

2
bitcoin/tx.c

@ -285,7 +285,7 @@ struct amount_asset bitcoin_tx_output_get_amount(const struct bitcoin_tx *tx,
return wally_tx_output_get_amount(&tx->wtx->outputs[outnum]);
}
void bitcoin_tx_output_get_amount_sat(struct bitcoin_tx *tx, int outnum,
void bitcoin_tx_output_get_amount_sat(const struct bitcoin_tx *tx, int outnum,
struct amount_sat *amount)
{
struct amount_asset asset_amt;

2
bitcoin/tx.h

@ -156,7 +156,7 @@ u8 *bitcoin_tx_output_get_witscript(const tal_t *ctx, const struct bitcoin_tx *t
* Internally we use a `wally_tx` to represent the transaction. The
* satoshi amount isn't a struct amount_sat, so we need a conversion
*/
void bitcoin_tx_output_get_amount_sat(struct bitcoin_tx *tx, int outnum,
void bitcoin_tx_output_get_amount_sat(const struct bitcoin_tx *tx, int outnum,
struct amount_sat *amount);
/**
* Helper to just get an amount_sat for the output amount.

Loading…
Cancel
Save