diff --git a/bitcoin/psbt.c b/bitcoin/psbt.c index 71f267e1d..0bd1c23a5 100644 --- a/bitcoin/psbt.c +++ b/bitcoin/psbt.c @@ -359,8 +359,8 @@ void psbt_elements_normalize_fees(struct wally_psbt *psbt) } } -bool psbt_has_input(struct wally_psbt *psbt, - struct bitcoin_txid *txid, +bool psbt_has_input(const struct wally_psbt *psbt, + const struct bitcoin_txid *txid, u32 outnum) { for (size_t i = 0; i < psbt->num_inputs; i++) { @@ -388,7 +388,7 @@ bool psbt_input_set_redeemscript(struct wally_psbt *psbt, size_t in, return wally_err == WALLY_OK; } -struct amount_sat psbt_input_get_amount(struct wally_psbt *psbt, +struct amount_sat psbt_input_get_amount(const struct wally_psbt *psbt, size_t in) { struct amount_sat val; @@ -408,7 +408,7 @@ struct amount_sat psbt_input_get_amount(struct wally_psbt *psbt, return val; } -struct amount_sat psbt_output_get_amount(struct wally_psbt *psbt, +struct amount_sat psbt_output_get_amount(const struct wally_psbt *psbt, size_t out) { struct amount_asset asset; diff --git a/bitcoin/psbt.h b/bitcoin/psbt.h index 312dcf22e..747982142 100644 --- a/bitcoin/psbt.h +++ b/bitcoin/psbt.h @@ -201,7 +201,7 @@ void psbt_output_add_unknown(struct wally_psbt_output *out, * @psbt - psbt * @in - index of input whose value you're returning * */ -struct amount_sat psbt_input_get_amount(struct wally_psbt *psbt, +struct amount_sat psbt_input_get_amount(const struct wally_psbt *psbt, size_t in); /* psbt_output_get_amount - Returns the value of this output @@ -209,7 +209,7 @@ struct amount_sat psbt_input_get_amount(struct wally_psbt *psbt, * @psbt - psbt * @out -index of output whose value you're returning */ -struct amount_sat psbt_output_get_amount(struct wally_psbt *psbt, +struct amount_sat psbt_output_get_amount(const struct wally_psbt *psbt, size_t out); /* psbt_has_input - Is this input present on this psbt @@ -218,8 +218,8 @@ struct amount_sat psbt_output_get_amount(struct wally_psbt *psbt, * @txid - txid of input * @outnum - output index of input */ -bool psbt_has_input(struct wally_psbt *psbt, - struct bitcoin_txid *txid, +bool psbt_has_input(const struct wally_psbt *psbt, + const struct bitcoin_txid *txid, u32 outnum); struct wally_psbt *psbt_from_b64(const tal_t *ctx,