From 63d9a688762953dbe0441b2ea5bc21c8035b4d62 Mon Sep 17 00:00:00 2001 From: ZmnSCPxj jxPCSnmZ Date: Wed, 22 Jul 2020 16:06:03 +0800 Subject: [PATCH] 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`. --- bitcoin/tx.c | 2 +- bitcoin/tx.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bitcoin/tx.c b/bitcoin/tx.c index 7265ff6d5562..c88612f082df 100644 --- a/bitcoin/tx.c +++ b/bitcoin/tx.c @@ -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; diff --git a/bitcoin/tx.h b/bitcoin/tx.h index cd63dbeb72b7..843da9b25632 100644 --- a/bitcoin/tx.h +++ b/bitcoin/tx.h @@ -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.