Skip to content

Commit

Permalink
Merge pull request #8885 from lightningnetwork/co-op-close-scid
Browse files Browse the repository at this point in the history
lnwallet: add short chan ID to AuxShutdownReq
  • Loading branch information
Roasbeef committed Jul 2, 2024
2 parents 9eec9b5 + c7011a6 commit 8d83880
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lnwallet/chancloser/aux_closer.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ type AuxShutdownReq struct {
// down.
ChanPoint wire.OutPoint

// ShortChanID is the short channel ID of the channel that is being
// closed.
ShortChanID lnwire.ShortChannelID

// Initiator is true if the local node is the initiator of the channel.
Initiator bool

Expand Down
6 changes: 5 additions & 1 deletion lnwallet/chancloser/chancloser.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ func (c *ChanCloser) initChanShutdown() (*lnwire.Shutdown, error) {
err := fn.MapOptionZ(c.cfg.AuxCloser, func(a AuxChanCloser) error {
shutdownCustomRecords, err := a.ShutdownBlob(AuxShutdownReq{
ChanPoint: c.chanPoint,
ShortChanID: c.cfg.Channel.ShortChanID(),
Initiator: c.cfg.Channel.IsInitiator(),
InternalKey: c.localInternalKey,
CommitBlob: c.cfg.Channel.LocalCommitmentBlob(),
Expand Down Expand Up @@ -978,7 +979,9 @@ func (c *ChanCloser) ReceiveClosingSigned( //nolint:funlen
c.cfg.AuxCloser, func(aux AuxChanCloser) error {
channel := c.cfg.Channel
req := AuxShutdownReq{
ChanPoint: c.chanPoint,
ChanPoint: c.chanPoint,
//nolint:lll
ShortChanID: c.cfg.Channel.ShortChanID(),
InternalKey: c.localInternalKey,
Initiator: channel.IsInitiator(),
//nolint:lll
Expand Down Expand Up @@ -1059,6 +1062,7 @@ func (c *ChanCloser) auxCloseOutputs(
err := fn.MapOptionZ(c.cfg.AuxCloser, func(aux AuxChanCloser) error {
req := AuxShutdownReq{
ChanPoint: c.chanPoint,
ShortChanID: c.cfg.Channel.ShortChanID(),
InternalKey: c.localInternalKey,
Initiator: c.cfg.Channel.IsInitiator(),
CommitBlob: c.cfg.Channel.LocalCommitmentBlob(),
Expand Down

0 comments on commit 8d83880

Please sign in to comment.