From 3c5f96de7c409e208f16b143acca5131aafd376a Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Sun, 24 Nov 2024 14:07:13 -0800 Subject: [PATCH] lnwallet/chancloser: enable custom payer for rbf coop close In this commit, we enable a custom payer for the rbf coop close. This allows us to ensure that the party that started one side of the close flow pays the fees. --- lnwallet/chancloser/rbf_coop_transitions.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lnwallet/chancloser/rbf_coop_transitions.go b/lnwallet/chancloser/rbf_coop_transitions.go index 2a7d95f9a..da45908b7 100644 --- a/lnwallet/chancloser/rbf_coop_transitions.go +++ b/lnwallet/chancloser/rbf_coop_transitions.go @@ -661,6 +661,7 @@ func (l *LocalCloseStart) ProcessEvent(event ProtocolEvent, env *Environment, rawSig, closeTx, closeBalance, err := env.CloseSigner.CreateCloseProposal( //nolint:ll absoluteFee, localScript, l.RemoteDeliveryScript, lnwallet.WithCustomSequence(mempool.MaxRBFSequence), + lnwallet.WithCustomPayer(lntypes.Local), ) if err != nil { return nil, err @@ -808,6 +809,7 @@ func (l *LocalOfferSent) ProcessEvent(event ProtocolEvent, env *Environment, localSig, remoteSig, l.LocalDeliveryScript, l.RemoteDeliveryScript, l.ProposedFee, lnwallet.WithCustomSequence(mempool.MaxRBFSequence), + lnwallet.WithCustomPayer(lntypes.Local), ) if err != nil { return nil, err @@ -903,6 +905,7 @@ func (l *RemoteCloseStart) ProcessEvent(event ProtocolEvent, env *Environment, chanOpts := []lnwallet.ChanCloseOpt{ lnwallet.WithCustomSequence(mempool.MaxRBFSequence), lnwallet.WithCustomLockTime(msg.SigMsg.LockTime), + lnwallet.WithCustomPayer(lntypes.Remote), } chancloserLog.Infof("responding to close w/ local_addr=%x, "+