mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-10 06:07:16 +01:00
funding: notify aux negotiator on ChannelReady
We notify the aux channel negotiator that an established channel is now ready to use.
This commit is contained in:
@@ -568,6 +568,11 @@ type Config struct {
|
||||
// AuxResolver is an optional interface that can be used to modify the
|
||||
// way contracts are resolved.
|
||||
AuxResolver fn.Option[lnwallet.AuxContractResolver]
|
||||
|
||||
// AuxChannelNegotiator is an optional interface that allows aux channel
|
||||
// implementations to inject and process custom records over channel
|
||||
// related wire messages.
|
||||
AuxChannelNegotiator fn.Option[lnwallet.AuxChannelNegotiator]
|
||||
}
|
||||
|
||||
// Manager acts as an orchestrator/bridge between the wallet's
|
||||
@@ -4019,6 +4024,14 @@ func (f *Manager) handleChannelReady(peer lnpeer.Peer, //nolint:funlen
|
||||
|
||||
defer f.wg.Done()
|
||||
|
||||
// Notify the aux hook that the specified peer just established a
|
||||
// channel with us, identified by the given channel ID.
|
||||
f.cfg.AuxChannelNegotiator.WhenSome(
|
||||
func(acn lnwallet.AuxChannelNegotiator) {
|
||||
acn.ProcessChannelReady(msg.ChanID, peer.PubKey())
|
||||
},
|
||||
)
|
||||
|
||||
// If we are in development mode, we'll wait for specified duration
|
||||
// before processing the channel ready message.
|
||||
if f.cfg.Dev != nil {
|
||||
|
||||
Reference in New Issue
Block a user