mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-26 01:33:02 +01:00
lnwallet: add WithAuxSigner option to channel
This commit is contained in:
parent
6d3f8af007
commit
b83783cc3d
@ -760,6 +760,10 @@ type LightningChannel struct {
|
||||
// signatures, of which there may be hundreds.
|
||||
sigPool *SigPool
|
||||
|
||||
// auxSigner is a special signer used to obtain opaque signatures for
|
||||
// custom channel variants.
|
||||
auxSigner fn.Option[AuxSigner]
|
||||
|
||||
// Capacity is the total capacity of this channel.
|
||||
Capacity btcutil.Amount
|
||||
|
||||
@ -821,6 +825,7 @@ type channelOpts struct {
|
||||
remoteNonce *musig2.Nonces
|
||||
|
||||
leafStore fn.Option[AuxLeafStore]
|
||||
auxSigner fn.Option[AuxSigner]
|
||||
|
||||
skipNonceInit bool
|
||||
}
|
||||
@ -859,6 +864,13 @@ func WithLeafStore(store AuxLeafStore) ChannelOpt {
|
||||
}
|
||||
}
|
||||
|
||||
// WithAuxSigner is used to specify a custom aux signer for the channel.
|
||||
func WithAuxSigner(signer AuxSigner) ChannelOpt {
|
||||
return func(o *channelOpts) {
|
||||
o.auxSigner = fn.Some[AuxSigner](signer)
|
||||
}
|
||||
}
|
||||
|
||||
// defaultChannelOpts returns the set of default options for a new channel.
|
||||
func defaultChannelOpts() *channelOpts {
|
||||
return &channelOpts{}
|
||||
@ -911,6 +923,7 @@ func NewLightningChannel(signer input.Signer,
|
||||
lc := &LightningChannel{
|
||||
Signer: signer,
|
||||
leafStore: opts.leafStore,
|
||||
auxSigner: opts.auxSigner,
|
||||
sigPool: sigPool,
|
||||
currentHeight: localCommit.CommitHeight,
|
||||
commitChains: commitChains,
|
||||
|
Loading…
x
Reference in New Issue
Block a user