Skip to content

Commit f4b5641

Browse files
Roasbeefguggero
authored andcommitted
lnwallet: add WithAuxSigner option to channel
1 parent ce70590 commit f4b5641

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

lnwallet/channel.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1336,6 +1336,10 @@ type LightningChannel struct {
13361336
// signatures, of which there may be hundreds.
13371337
sigPool *SigPool
13381338

1339+
// auxSigner is a special signer used to obtain opaque signatures for
1340+
// custom channel variants.
1341+
auxSigner fn.Option[AuxSigner]
1342+
13391343
// Capacity is the total capacity of this channel.
13401344
Capacity btcutil.Amount
13411345

@@ -1400,6 +1404,7 @@ type channelOpts struct {
14001404
remoteNonce *musig2.Nonces
14011405

14021406
leafStore fn.Option[AuxLeafStore]
1407+
auxSigner fn.Option[AuxSigner]
14031408

14041409
skipNonceInit bool
14051410
}
@@ -1438,6 +1443,13 @@ func WithLeafStore(store AuxLeafStore) ChannelOpt {
14381443
}
14391444
}
14401445

1446+
// WithAuxSigner is used to specify a custom aux signer for the channel.
1447+
func WithAuxSigner(signer AuxSigner) ChannelOpt {
1448+
return func(o *channelOpts) {
1449+
o.auxSigner = fn.Some[AuxSigner](signer)
1450+
}
1451+
}
1452+
14411453
// defaultChannelOpts returns the set of default options for a new channel.
14421454
func defaultChannelOpts() *channelOpts {
14431455
return &channelOpts{}
@@ -1481,6 +1493,7 @@ func NewLightningChannel(signer input.Signer,
14811493
lc := &LightningChannel{
14821494
Signer: signer,
14831495
leafStore: opts.leafStore,
1496+
auxSigner: opts.auxSigner,
14841497
sigPool: sigPool,
14851498
currentHeight: localCommit.CommitHeight,
14861499
remoteCommitChain: newCommitmentChain(),

0 commit comments

Comments
 (0)