Skip to content

Commit 26e1a0c

Browse files
Roasbeefguggero
authored andcommitted
lnwallet: add WithAuxSigner option to channel
1 parent 1763bfd commit 26e1a0c

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
@@ -1377,6 +1377,10 @@ type LightningChannel struct {
13771377
// signatures, of which there may be hundreds.
13781378
sigPool *SigPool
13791379

1380+
// auxSigner is a special signer used to obtain opaque signatures for
1381+
// custom channel variants.
1382+
auxSigner fn.Option[AuxSigner]
1383+
13801384
// Capacity is the total capacity of this channel.
13811385
Capacity btcutil.Amount
13821386

@@ -1441,6 +1445,7 @@ type channelOpts struct {
14411445
remoteNonce *musig2.Nonces
14421446

14431447
leafStore fn.Option[AuxLeafStore]
1448+
auxSigner fn.Option[AuxSigner]
14441449

14451450
skipNonceInit bool
14461451
}
@@ -1479,6 +1484,13 @@ func WithLeafStore(store AuxLeafStore) ChannelOpt {
14791484
}
14801485
}
14811486

1487+
// WithAuxSigner is used to specify a custom aux signer for the channel.
1488+
func WithAuxSigner(signer AuxSigner) ChannelOpt {
1489+
return func(o *channelOpts) {
1490+
o.auxSigner = fn.Some[AuxSigner](signer)
1491+
}
1492+
}
1493+
14821494
// defaultChannelOpts returns the set of default options for a new channel.
14831495
func defaultChannelOpts() *channelOpts {
14841496
return &channelOpts{}
@@ -1522,6 +1534,7 @@ func NewLightningChannel(signer input.Signer,
15221534
lc := &LightningChannel{
15231535
Signer: signer,
15241536
leafStore: opts.leafStore,
1537+
auxSigner: opts.auxSigner,
15251538
sigPool: sigPool,
15261539
currentHeight: localCommit.CommitHeight,
15271540
remoteCommitChain: newCommitmentChain(),

0 commit comments

Comments
 (0)