Browse Source

bitcoin/psbt: more const pointers.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
travis-experimental
Rusty Russell 4 years ago
parent
commit
80c705d528
  1. 8
      bitcoin/psbt.c
  2. 8
      bitcoin/psbt.h

8
bitcoin/psbt.c

@ -359,8 +359,8 @@ void psbt_elements_normalize_fees(struct wally_psbt *psbt)
} }
} }
bool psbt_has_input(struct wally_psbt *psbt, bool psbt_has_input(const struct wally_psbt *psbt,
struct bitcoin_txid *txid, const struct bitcoin_txid *txid,
u32 outnum) u32 outnum)
{ {
for (size_t i = 0; i < psbt->num_inputs; i++) { 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; 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) size_t in)
{ {
struct amount_sat val; struct amount_sat val;
@ -408,7 +408,7 @@ struct amount_sat psbt_input_get_amount(struct wally_psbt *psbt,
return val; 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) size_t out)
{ {
struct amount_asset asset; struct amount_asset asset;

8
bitcoin/psbt.h

@ -201,7 +201,7 @@ void psbt_output_add_unknown(struct wally_psbt_output *out,
* @psbt - psbt * @psbt - psbt
* @in - index of input whose value you're returning * @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); size_t in);
/* psbt_output_get_amount - Returns the value of this output /* 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 * @psbt - psbt
* @out -index of output whose value you're returning * @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); size_t out);
/* psbt_has_input - Is this input present on this psbt /* 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 * @txid - txid of input
* @outnum - output index of input * @outnum - output index of input
*/ */
bool psbt_has_input(struct wally_psbt *psbt, bool psbt_has_input(const struct wally_psbt *psbt,
struct bitcoin_txid *txid, const struct bitcoin_txid *txid,
u32 outnum); u32 outnum);
struct wally_psbt *psbt_from_b64(const tal_t *ctx, struct wally_psbt *psbt_from_b64(const tal_t *ctx,

Loading…
Cancel
Save