From a1204a0b9405a8464291edec5d2fa17480224e39 Mon Sep 17 00:00:00 2001 From: trueptolemy Date: Mon, 30 Sep 2019 03:12:26 +0800 Subject: [PATCH] Closed: Cleanup for `wire_closing_init` `final_scriptpubkey` is repeated with `funding_pubkey[LOCAL]`. --- closingd/closing_wire.csv | 2 -- closingd/closingd.c | 8 ++------ lightningd/closing_control.c | 2 -- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/closingd/closing_wire.csv b/closingd/closing_wire.csv index 47e03203d..0c5bcff72 100644 --- a/closingd/closing_wire.csv +++ b/closingd/closing_wire.csv @@ -27,8 +27,6 @@ msgdata,closing_init,next_index_remote,u64, msgdata,closing_init,revocations_received,u64, msgdata,closing_init,channel_reestablish_len,u16, msgdata,closing_init,channel_reestablish,u8,channel_reestablish_len -msgdata,closing_init,final_scriptpubkey_len,u16, -msgdata,closing_init,final_scriptpubkey,u8,final_scriptpubkey_len msgdata,closing_init,last_remote_secret,secret, msgdata,closing_init,dev_fast_gossip,bool, diff --git a/closingd/closingd.c b/closingd/closingd.c index 0360ee774..04b354388 100644 --- a/closingd/closingd.c +++ b/closingd/closingd.c @@ -569,7 +569,7 @@ int main(int argc, char *argv[]) struct amount_sat min_fee_to_accept, commitment_fee, offer[NUM_SIDES]; struct feerange feerange; enum side funder; - u8 *scriptpubkey[NUM_SIDES], *funding_wscript, *final_scriptpubkey; + u8 *scriptpubkey[NUM_SIDES], *funding_wscript; struct channel_id channel_id; bool reconnected; u64 next_index[NUM_SIDES], revocations_received; @@ -602,7 +602,6 @@ int main(int argc, char *argv[]) &next_index[REMOTE], &revocations_received, &channel_reestablish, - &final_scriptpubkey, &last_remote_per_commit_secret, &dev_fast_gossip)) master_badmsg(WIRE_CLOSING_INIT, msg); @@ -626,12 +625,9 @@ int main(int argc, char *argv[]) if (reconnected) do_reconnect(pps, &channel_id, next_index, revocations_received, - channel_reestablish, final_scriptpubkey, + channel_reestablish, scriptpubkey[LOCAL], &last_remote_per_commit_secret); - /* We don't need this any more */ - tal_free(final_scriptpubkey); - peer_billboard(true, "Negotiating closing fee between %s" " and %s satoshi (ideal %s)", type_to_string(tmpctx, struct amount_sat, diff --git a/lightningd/closing_control.c b/lightningd/closing_control.c index 0d3c972b9..419d02b6c 100644 --- a/lightningd/closing_control.c +++ b/lightningd/closing_control.c @@ -299,8 +299,6 @@ void peer_start_closingd(struct channel *channel, channel->next_index[REMOTE], num_revocations, channel_reestablish, - p2wpkh_for_keyidx(tmpctx, ld, - channel->final_key_idx), &last_remote_per_commit_secret, IFDEV(ld->dev_fast_gossip, false));