Skip to content

Commit

Permalink
funding+peer: add support for new musig2 channel funding flow
Browse files Browse the repository at this point in the history
In this commit, we add support for the new musig2 channel funding flow.
This flow is identical to the existing flow, but not both sides need to
exchange local nonces up front, and then signatures sent are now partial
signatures instead of regular signatures.

The funding manager also gains some new state of the local nonces it
needs to generate in order to send the funding locked message, and also
process the funding locked message from the remote party.

In order to allow the funding manger to generate the nonces that need to
be applied to each channel, then AddNewChannel method has been modified
to accept a set of options that the peer will then use to bind the
nonces to a new channel.
  • Loading branch information
Roasbeef committed Aug 22, 2023
1 parent a841630 commit 15978a8
Show file tree
Hide file tree
Showing 9 changed files with 347 additions and 60 deletions.
5 changes: 3 additions & 2 deletions discovery/mock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (

"github.com/btcsuite/btcd/btcec/v2"
"github.com/btcsuite/btcd/wire"
"github.com/lightningnetwork/lnd/channeldb"
"github.com/lightningnetwork/lnd/lnpeer"
"github.com/lightningnetwork/lnd/lnwire"
)
Expand Down Expand Up @@ -42,7 +41,9 @@ func (p *mockPeer) SendMessageLazy(sync bool, msgs ...lnwire.Message) error {
return p.SendMessage(sync, msgs...)
}

func (p *mockPeer) AddNewChannel(_ *channeldb.OpenChannel, _ <-chan struct{}) error {
func (p *mockPeer) AddNewChannel(_ *lnpeer.NewChannel,
_ <-chan struct{}) error {

return nil
}
func (p *mockPeer) WipeChannel(_ *wire.OutPoint) {}
Expand Down
Loading

0 comments on commit 15978a8

Please sign in to comment.