Skip to content

Commit

Permalink
bitcoin/tx.c: bitcoin_tx_output_get_amount_sat now accepts const
Browse files Browse the repository at this point in the history
…transactions.

It is a getter, so, does not change the transaction, so should accept `const`.
  • Loading branch information
ZmnSCPxj committed Jul 22, 2020
1 parent 6c98bcb commit 63d9a68
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bitcoin/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,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;
Expand Down
2 changes: 1 addition & 1 deletion bitcoin/tx.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,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.
Expand Down

0 comments on commit 63d9a68

Please sign in to comment.