multi: add new config option upfront-shutdown-address

Introduced a new config value `upfront-shutdown-address`
in the `lnd.conf` file. This ensures that channel close
funds are transferred to the specified shutdown address.
The value applies to both the funder and the fundee but
can be overridden by the value specified during
`openchannel` or by the `channel acceptor`.

NOTE: If this field is set when opening a channel with a
peer that does not advertise support for upfront shutdown
feature, the channel open will fail.

Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com>
This commit is contained in:
Nishant Bansal committed 2025-11-13 19:32:51 +05:30
1 parent af6816b344
commit e4c4d946fd
5 files changed
+62 -6

No files matched your search

+4 -4
View File
@@ -3589,9 +3589,9 @@ func (p *Brontide) initNegotiateChanCloser(req *htlcswitch.ChanClose,
return nil
}
// chooseAddr returns the provided address if it is non-zero length, otherwise
// ChooseAddr returns the provided address if it is non-zero length, otherwise
// None.
func chooseAddr(addr lnwire.DeliveryAddress) fn.Option[lnwire.DeliveryAddress] {
func ChooseAddr(addr lnwire.DeliveryAddress) fn.Option[lnwire.DeliveryAddress] {
if len(addr) == 0 {
return fn.None[lnwire.DeliveryAddress]()
}
@@ -3930,10 +3930,10 @@ func (p *Brontide) initRbfChanCloser(
ChanType: channel.ChanType(),
DefaultFeeRate: defaultFeePerKw.FeePerVByte(),
ThawHeight: fn.Some(thawHeight),
RemoteUpfrontShutdown: chooseAddr(
RemoteUpfrontShutdown: ChooseAddr(
channel.RemoteUpfrontShutdownScript(),
),
LocalUpfrontShutdown: chooseAddr(
LocalUpfrontShutdown: ChooseAddr(
channel.LocalUpfrontShutdownScript(),
),
NewDeliveryScript: func() (lnwire.DeliveryAddress, error) {