Skip to content

Commit e9e10cc

Browse files
Roasbeefguggero
authored andcommitted
lnwallet: add WithAuxSigner option to channel
1 parent a6b56da commit e9e10cc

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
@@ -1334,6 +1334,10 @@ type LightningChannel struct {
13341334
// signatures, of which there may be hundreds.
13351335
sigPool *SigPool
13361336

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

@@ -1398,6 +1402,7 @@ type channelOpts struct {
13981402
remoteNonce *musig2.Nonces
13991403

14001404
leafStore fn.Option[AuxLeafStore]
1405+
auxSigner fn.Option[AuxSigner]
14011406

14021407
skipNonceInit bool
14031408
}
@@ -1436,6 +1441,13 @@ func WithLeafStore(store AuxLeafStore) ChannelOpt {
14361441
}
14371442
}
14381443

1444+
// WithAuxSigner is used to specify a custom aux signer for the channel.
1445+
func WithAuxSigner(signer AuxSigner) ChannelOpt {
1446+
return func(o *channelOpts) {
1447+
o.auxSigner = fn.Some[AuxSigner](signer)
1448+
}
1449+
}
1450+
14391451
// defaultChannelOpts returns the set of default options for a new channel.
14401452
func defaultChannelOpts() *channelOpts {
14411453
return &channelOpts{}
@@ -1479,6 +1491,7 @@ func NewLightningChannel(signer input.Signer,
14791491
lc := &LightningChannel{
14801492
Signer: signer,
14811493
leafStore: opts.leafStore,
1494+
auxSigner: opts.auxSigner,
14821495
sigPool: sigPool,
14831496
currentHeight: localCommit.CommitHeight,
14841497
remoteCommitChain: newCommitmentChain(),

0 commit comments

Comments
 (0)