mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-21 23:32:07 +01:00
lnwallet: generate local nonces if non passed in for taproot chans
This ensures that when loading the channel again after a normal chan reest, we generate the local nonces, which ensures we can then process nonces the remote party sends us in their chan reest message.
This commit is contained in:
parent
9ce817511d
commit
410baae0c7
@ -1421,10 +1421,20 @@ func NewLightningChannel(signer input.Signer,
|
||||
log: build.NewPrefixLog(logPrefix, walletLog),
|
||||
}
|
||||
|
||||
switch {
|
||||
// At this point, we may already have nonces that were passed in, so
|
||||
// we'll check that now as this lets us skip some steps later.
|
||||
if opts.localNonce != nil {
|
||||
case state.ChanType.IsTaproot() && opts.localNonce != nil:
|
||||
lc.pendingVerificationNonce = opts.localNonce
|
||||
|
||||
// Otherwise, we'll generate the nonces here ourselves. This ensures
|
||||
// we'll be ablve to process the chan syncmessag efrom the remote
|
||||
// party.
|
||||
case state.ChanType.IsTaproot() && opts.localNonce == nil:
|
||||
_, err := lc.GenMusigNonces()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
if lc.pendingVerificationNonce != nil && opts.remoteNonce != nil {
|
||||
err := lc.InitRemoteMusigNonces(opts.remoteNonce)
|
||||
|
Loading…
x
Reference in New Issue
Block a user