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.
This commit is contained in:
Olaoluwa Osuntokun 2024-11-24 14:07:13 -08:00
parent d38c5e6222
commit 3c5f96de7c
No known key found for this signature in database
GPG Key ID: 90525F7DEEE0AD86

View File

@ -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, "+