Skip to content

Commit

Permalink
server+peer: init peer struct w/ AuxChanCloser if present
Browse files Browse the repository at this point in the history
  • Loading branch information
Roasbeef authored and guggero committed Sep 19, 2024
1 parent 625d426 commit 44ab7e6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions config_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import (
"github.com/lightningnetwork/lnd/lnrpc"
"github.com/lightningnetwork/lnd/lnwallet"
"github.com/lightningnetwork/lnd/lnwallet/btcwallet"
"github.com/lightningnetwork/lnd/lnwallet/chancloser"
"github.com/lightningnetwork/lnd/lnwallet/rpcwallet"
"github.com/lightningnetwork/lnd/macaroons"
"github.com/lightningnetwork/lnd/msgmux"
Expand Down Expand Up @@ -182,6 +183,10 @@ type AuxComponents struct {
// AuxDataParser is an optional data parser that can be used to parse
// auxiliary data for certain custom channel types.
AuxDataParser fn.Option[AuxDataParser]

// AuxChanCloser is an optional channel closer that can be used to
// modify the way a coop-close transaction is constructed.
AuxChanCloser fn.Option[chancloser.AuxChanCloser]
}

// DefaultWalletImpl is the default implementation of our normal, btcwallet
Expand Down
4 changes: 4 additions & 0 deletions peer/brontide.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,10 @@ type Config struct {
// in place.
MsgRouter fn.Option[msgmux.Router]

// AuxChanCloser is an optional instance of an abstraction that can be
// used to modify the way the co-op close transaction is constructed.
AuxChanCloser fn.Option[chancloser.AuxChanCloser]

// Quit is the server's quit channel. If this is closed, we halt operation.
Quit chan struct{}
}
Expand Down
1 change: 1 addition & 0 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -4106,6 +4106,7 @@ func (s *server) peerConnected(conn net.Conn, connReq *connmgr.ConnReq,
AuxLeafStore: s.implCfg.AuxLeafStore,
AuxSigner: s.implCfg.AuxSigner,
MsgRouter: s.implCfg.MsgRouter,
AuxChanCloser: s.implCfg.AuxChanCloser,
}

copy(pCfg.PubKeyBytes[:], peerAddr.IdentityKey.SerializeCompressed())
Expand Down

0 comments on commit 44ab7e6

Please sign in to comment.