Skip to content

Commit 44ab7e6

Browse files
Roasbeefguggero
authored andcommitted
server+peer: init peer struct w/ AuxChanCloser if present
1 parent 625d426 commit 44ab7e6

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

config_builder.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ import (
4242
"github.com/lightningnetwork/lnd/lnrpc"
4343
"github.com/lightningnetwork/lnd/lnwallet"
4444
"github.com/lightningnetwork/lnd/lnwallet/btcwallet"
45+
"github.com/lightningnetwork/lnd/lnwallet/chancloser"
4546
"github.com/lightningnetwork/lnd/lnwallet/rpcwallet"
4647
"github.com/lightningnetwork/lnd/macaroons"
4748
"github.com/lightningnetwork/lnd/msgmux"
@@ -182,6 +183,10 @@ type AuxComponents struct {
182183
// AuxDataParser is an optional data parser that can be used to parse
183184
// auxiliary data for certain custom channel types.
184185
AuxDataParser fn.Option[AuxDataParser]
186+
187+
// AuxChanCloser is an optional channel closer that can be used to
188+
// modify the way a coop-close transaction is constructed.
189+
AuxChanCloser fn.Option[chancloser.AuxChanCloser]
185190
}
186191

187192
// DefaultWalletImpl is the default implementation of our normal, btcwallet

peer/brontide.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,10 @@ type Config struct {
400400
// in place.
401401
MsgRouter fn.Option[msgmux.Router]
402402

403+
// AuxChanCloser is an optional instance of an abstraction that can be
404+
// used to modify the way the co-op close transaction is constructed.
405+
AuxChanCloser fn.Option[chancloser.AuxChanCloser]
406+
403407
// Quit is the server's quit channel. If this is closed, we halt operation.
404408
Quit chan struct{}
405409
}

server.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4106,6 +4106,7 @@ func (s *server) peerConnected(conn net.Conn, connReq *connmgr.ConnReq,
41064106
AuxLeafStore: s.implCfg.AuxLeafStore,
41074107
AuxSigner: s.implCfg.AuxSigner,
41084108
MsgRouter: s.implCfg.MsgRouter,
4109+
AuxChanCloser: s.implCfg.AuxChanCloser,
41094110
}
41104111

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

0 commit comments

Comments
 (0)