From c6ad4f9b2002655278d833ef2369085658305e9d Mon Sep 17 00:00:00 2001 From: niftynei Date: Fri, 16 Oct 2020 13:16:49 -0500 Subject: [PATCH] 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. --- lightningd/channel.h | 2 +- lightningd/dual_open_control.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lightningd/channel.h b/lightningd/channel.h index 2a277e595..be6a17a65 100644 --- a/lightningd/channel.h +++ b/lightningd/channel.h @@ -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 */ diff --git a/lightningd/dual_open_control.c b/lightningd/dual_open_control.c index db492d039..6348a072f 100644 --- a/lightningd/dual_open_control.c +++ b/lightningd/dual_open_control.c @@ -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);