@@ -19,6 +19,7 @@ import (
1919 "github.com/lightningnetwork/lnd/lnutils"
2020 "github.com/lightningnetwork/lnd/lnwallet"
2121 "github.com/lightningnetwork/lnd/lnwallet/chainfee"
22+ "github.com/lightningnetwork/lnd/lnwallet/types"
2223 "github.com/lightningnetwork/lnd/lnwire"
2324)
2425
@@ -239,12 +240,12 @@ type ChanCloser struct {
239240 // localCloseOutput is the local output on the closing transaction that
240241 // the local party should be paid to. This will only be populated if the
241242 // local balance isn't dust.
242- localCloseOutput fn.Option [CloseOutput ]
243+ localCloseOutput fn.Option [types. CloseOutput ]
243244
244245 // remoteCloseOutput is the remote output on the closing transaction
245246 // that the remote party should be paid to. This will only be populated
246247 // if the remote balance isn't dust.
247- remoteCloseOutput fn.Option [CloseOutput ]
248+ remoteCloseOutput fn.Option [types. CloseOutput ]
248249
249250 // auxOutputs are the optional additional outputs that might be added to
250251 // the closing transaction.
@@ -378,14 +379,17 @@ func (c *ChanCloser) initChanShutdown() (*lnwire.Shutdown, error) {
378379 // At this point, we'll check to see if we have any custom records to
379380 // add to the shutdown message.
380381 err := fn .MapOptionZ (c .cfg .AuxCloser , func (a AuxChanCloser ) error {
381- shutdownCustomRecords , err := a .ShutdownBlob (AuxShutdownReq {
382- ChanPoint : c .chanPoint ,
383- ShortChanID : c .cfg .Channel .ShortChanID (),
384- Initiator : c .cfg .Channel .IsInitiator (),
385- InternalKey : c .localInternalKey ,
386- CommitBlob : c .cfg .Channel .LocalCommitmentBlob (),
387- FundingBlob : c .cfg .Channel .FundingBlob (),
388- })
382+ channel := c .cfg .Channel
383+ shutdownCustomRecords , err := a .ShutdownBlob (
384+ types.AuxShutdownReq {
385+ ChanPoint : c .chanPoint ,
386+ ShortChanID : channel .ShortChanID (),
387+ Initiator : channel .IsInitiator (),
388+ InternalKey : c .localInternalKey ,
389+ CommitBlob : channel .LocalCommitmentBlob (),
390+ FundingBlob : channel .FundingBlob (),
391+ },
392+ )
389393 if err != nil {
390394 return err
391395 }
@@ -442,7 +446,7 @@ func (c *ChanCloser) initChanShutdown() (*lnwire.Shutdown, error) {
442446 // it might still carry value in custom channel terms.
443447 _ , dustAmt := c .cfg .Channel .LocalBalanceDust ()
444448 localBalance , _ := c .cfg .Channel .CommitBalances ()
445- c .localCloseOutput = fn .Some (CloseOutput {
449+ c .localCloseOutput = fn .Some (types. CloseOutput {
446450 Amt : localBalance ,
447451 DustLimit : dustAmt ,
448452 PkScript : c .localDeliveryScript ,
@@ -519,12 +523,12 @@ func (c *ChanCloser) NegotiationHeight() uint32 {
519523}
520524
521525// LocalCloseOutput returns the local close output.
522- func (c * ChanCloser ) LocalCloseOutput () fn.Option [CloseOutput ] {
526+ func (c * ChanCloser ) LocalCloseOutput () fn.Option [types. CloseOutput ] {
523527 return c .localCloseOutput
524528}
525529
526530// RemoteCloseOutput returns the remote close output.
527- func (c * ChanCloser ) RemoteCloseOutput () fn.Option [CloseOutput ] {
531+ func (c * ChanCloser ) RemoteCloseOutput () fn.Option [types. CloseOutput ] {
528532 return c .remoteCloseOutput
529533}
530534
@@ -590,7 +594,7 @@ func (c *ChanCloser) ReceiveShutdown(msg lnwire.Shutdown) (
590594 // terms, it might still carry value in custom channel terms.
591595 _ , dustAmt := c .cfg .Channel .RemoteBalanceDust ()
592596 _ , remoteBalance := c .cfg .Channel .CommitBalances ()
593- c .remoteCloseOutput = fn .Some (CloseOutput {
597+ c .remoteCloseOutput = fn .Some (types. CloseOutput {
594598 Amt : remoteBalance ,
595599 DustLimit : dustAmt ,
596600 PkScript : msg .Address ,
@@ -976,15 +980,15 @@ func (c *ChanCloser) ReceiveClosingSigned( //nolint:funlen
976980 c .cfg .AuxCloser , func (aux AuxChanCloser ) error {
977981 channel := c .cfg .Channel
978982 //nolint:ll
979- req := AuxShutdownReq {
983+ req := types. AuxShutdownReq {
980984 ChanPoint : c .chanPoint ,
981985 ShortChanID : c .cfg .Channel .ShortChanID (),
982986 InternalKey : c .localInternalKey ,
983987 Initiator : channel .IsInitiator (),
984988 CommitBlob : channel .LocalCommitmentBlob (),
985989 FundingBlob : channel .FundingBlob (),
986990 }
987- desc := AuxCloseDesc {
991+ desc := types. AuxCloseDesc {
988992 AuxShutdownReq : req ,
989993 LocalCloseOutput : c .localCloseOutput ,
990994 RemoteCloseOutput : c .remoteCloseOutput ,
@@ -1053,15 +1057,15 @@ func (c *ChanCloser) auxCloseOutputs(
10531057
10541058 var closeOuts fn.Option [AuxCloseOutputs ]
10551059 err := fn .MapOptionZ (c .cfg .AuxCloser , func (aux AuxChanCloser ) error {
1056- req := AuxShutdownReq {
1060+ req := types. AuxShutdownReq {
10571061 ChanPoint : c .chanPoint ,
10581062 ShortChanID : c .cfg .Channel .ShortChanID (),
10591063 InternalKey : c .localInternalKey ,
10601064 Initiator : c .cfg .Channel .IsInitiator (),
10611065 CommitBlob : c .cfg .Channel .LocalCommitmentBlob (),
10621066 FundingBlob : c .cfg .Channel .FundingBlob (),
10631067 }
1064- outs , err := aux .AuxCloseOutputs (AuxCloseDesc {
1068+ outs , err := aux .AuxCloseOutputs (types. AuxCloseDesc {
10651069 AuxShutdownReq : req ,
10661070 CloseFee : closeFee ,
10671071 CommitFee : c .cfg .Channel .CommitFee (),
0 commit comments