From b06dabfcb99f9c4018f38d597b982a4f9d5e66ff Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Mon, 13 Aug 2018 19:15:54 -0700 Subject: [PATCH] lnwallet: properly set auxiliary channel recovery info in NewUnilateralCloseSummary In this commit, we fix a slight bug by ensuring that the revocation info at the final state of the channel, as well as the local chan config is properly set within the channel close summary created within NewUnilateralCloseSummary. Before this commit, for all cooperative close transactions, this state would _only_ include the pubkey itself, which in some cases may not be sufficient to re-derive the key if needed. --- lnwallet/channel.go | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/lnwallet/channel.go b/lnwallet/channel.go index 4c4cf97e..379ccbb7 100644 --- a/lnwallet/channel.go +++ b/lnwallet/channel.go @@ -5094,15 +5094,18 @@ func NewUnilateralCloseSummary(chanState *channeldb.OpenChannel, signer Signer, } closeSummary := channeldb.ChannelCloseSummary{ - ChanPoint: chanState.FundingOutpoint, - ChainHash: chanState.ChainHash, - ClosingTXID: *commitSpend.SpenderTxHash, - CloseHeight: uint32(commitSpend.SpendingHeight), - RemotePub: chanState.IdentityPub, - Capacity: chanState.Capacity, - SettledBalance: btcutil.Amount(localBalance), - CloseType: channeldb.RemoteForceClose, - IsPending: true, + ChanPoint: chanState.FundingOutpoint, + ChainHash: chanState.ChainHash, + ClosingTXID: *commitSpend.SpenderTxHash, + CloseHeight: uint32(commitSpend.SpendingHeight), + RemotePub: chanState.IdentityPub, + Capacity: chanState.Capacity, + SettledBalance: btcutil.Amount(localBalance), + CloseType: channeldb.RemoteForceClose, + IsPending: true, + RemoteCurrentRevocation: chanState.RemoteCurrentRevocation, + RemoteNextRevocation: chanState.RemoteNextRevocation, + LocalChanConfig: chanState.LocalChanCfg, } return &UnilateralCloseSummary{