From 03d7d8f45a3f3d294350a012d9c11342f7aae0e5 Mon Sep 17 00:00:00 2001 From: Dusty Daemon Date: Fri, 4 Oct 2024 16:40:31 -0400 Subject: [PATCH] splice: Update funding pubkey on splice lock Set the remote funding pubkey on both lightningd and channeld when mutual splice lock is achieved. This will be needed once rotating funding keys is enabled during splicing Changelog-None. --- channeld/channeld.c | 2 ++ lightningd/peer_control.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/channeld/channeld.c b/channeld/channeld.c index 3e7edb5ed..fd0cde7f9 100644 --- a/channeld/channeld.c +++ b/channeld/channeld.c @@ -491,6 +491,8 @@ static void check_mutual_splice_locked(struct peer *peer) "Splice lock unable to update funding. %s", error); + peer->channel->funding_pubkey[REMOTE] = inflight->remote_funding; + status_debug("mutual splice_locked, channel updated to: %s", fmt_channel(tmpctx, peer->channel)); diff --git a/lightningd/peer_control.c b/lightningd/peer_control.c index 0f031a619..90127ffdf 100644 --- a/lightningd/peer_control.c +++ b/lightningd/peer_control.c @@ -2058,6 +2058,10 @@ void update_channel_from_inflight(struct lightningd *ld, bitcoin_tx_with_psbt(channel, psbt_copy), &inflight->last_sig); + /* If the remote side rotated their pubkey during splice, update now */ + if (inflight->funding->splice_remote_funding) + channel->channel_info.remote_fundingkey = *inflight->funding->splice_remote_funding; + /* Update the reserve */ channel_update_reserve(channel, &channel->channel_info.their_config,