channel.psbt: make non-const

We update it in the next patch, which technically breaks this contract.
So we shouldn't have the contract of const on this in the first place
then.
This commit is contained in:
niftynei
2020-10-16 13:16:49 -05:00
committed by Rusty Russell
parent bdf1cc2f93
commit c6ad4f9b20
2 changed files with 4 additions and 2 deletions

View File

@@ -150,7 +150,7 @@ struct channel {
u64 rr_number;
/* PSBT, for v2 channels. Saved until it's sent */
const struct wally_psbt *psbt;
struct wally_psbt *psbt;
/* Stashed pps, saved until channeld is started.
* Needed only for v2 channel open flow */

View File

@@ -43,7 +43,9 @@ static void handle_signed_psbt(struct lightningd *ld,
struct commit_rcvd *rcvd)
{
/* Now that we've got the signed PSBT, save it */
rcvd->channel->psbt = tal_steal(rcvd->channel, psbt);
rcvd->channel->psbt =
tal_steal(rcvd->channel,
cast_const(struct wally_psbt *, psbt));
wallet_channel_save(ld->wallet, rcvd->channel);
channel_watch_funding(ld, rcvd->channel);