lnwallet: update CoopCloseBalance to allow a paying party

This preps us for an upcoming change to the rbf coop state machine where
either party can pay for the channel fees. We also add a new test to
make sure the new function adheres to some key properties.
This commit is contained in:
Olaoluwa Osuntokun committed 2024-12-10 23:07:02 +01:00
1 parent b8cf5ae98f
commit d1b2bff2c8
3 files changed
+268 -6

No files matched your search

+2
View File
@@ -8289,6 +8289,7 @@ func (lc *LightningChannel) CreateCloseProposal(proposedFee btcutil.Amount,
lc.channelState.LocalCommitment.LocalBalance.ToSatoshis(),
lc.channelState.LocalCommitment.RemoteBalance.ToSatoshis(),
lc.channelState.LocalCommitment.CommitFee,
fn.None[lntypes.ChannelParty](),
)
if err != nil {
return nil, nil, 0, err
@@ -8402,6 +8403,7 @@ func (lc *LightningChannel) CompleteCooperativeClose(
lc.channelState.LocalCommitment.LocalBalance.ToSatoshis(),
lc.channelState.LocalCommitment.RemoteBalance.ToSatoshis(),
lc.channelState.LocalCommitment.CommitFee,
fn.None[lntypes.ChannelParty](),
)
if err != nil {
return nil, 0, err