Skip to content

Commit

Permalink
x - delete logs for funding manager
Browse files Browse the repository at this point in the history
  • Loading branch information
yyforyongyu committed Nov 1, 2024
1 parent ac280e1 commit 2b25a55
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions funding/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -3904,6 +3904,8 @@ func (f *Manager) handleChannelReady(peer lnpeer.Peer, //nolint:funlen
"peer %x", msg.ChanID,
peer.IdentityKey().SerializeCompressed())

defer log.Debugf("----> Done processing ChannelReady")

// We now load or create a new channel barrier for this channel.
_, loaded := f.handleChannelReadyBarriers.LoadOrStore(
msg.ChanID, struct{}{},
Expand All @@ -3924,6 +3926,8 @@ func (f *Manager) handleChannelReady(peer lnpeer.Peer, //nolint:funlen

localDiscoverySignal, ok := f.localDiscoverySignals.Load(msg.ChanID)
if ok {
log.Debugf("----> waiting for localDiscoverySignal")

// Before we proceed with processing the channel_ready
// message, we'll wait for the local waitForFundingConfirmation
// goroutine to signal that it has the necessary state in
Expand All @@ -3941,6 +3945,8 @@ func (f *Manager) handleChannelReady(peer lnpeer.Peer, //nolint:funlen
f.localDiscoverySignals.Delete(msg.ChanID)
}

log.Debugf("----> waiting for FindChannel")

// First, we'll attempt to locate the channel whose funding workflow is
// being finalized by this message. We go to the database rather than
// our reservation map as we may have restarted, mid funding flow. Also
Expand All @@ -3957,6 +3963,7 @@ func (f *Manager) handleChannelReady(peer lnpeer.Peer, //nolint:funlen
// the remote party needs to send the next remote commitment here.
var firstVerNonce *musig2.Nonces
if channel.ChanType.IsTaproot() {
log.Debugf("----> waiting for genFirstStateMusigNonce")
firstVerNonce, err = genFirstStateMusigNonce(channel)
if err != nil {
log.Error(err)
Expand Down Expand Up @@ -4032,6 +4039,7 @@ func (f *Manager) handleChannelReady(peer lnpeer.Peer, //nolint:funlen
firstVerNonce.PubNonce,
)
}
log.Debugf("----> waiting for SendMessage blocking")

err = peer.SendMessage(true, channelReadyMsg)
if err != nil {
Expand Down Expand Up @@ -4062,6 +4070,9 @@ func (f *Manager) handleChannelReady(peer lnpeer.Peer, //nolint:funlen
// required in order to make the channel whole.
var chanOpts []lnwallet.ChannelOpt
if channel.ChanType.IsTaproot() {

log.Debugf("----> waiting for gen firstVerNonce")

f.nonceMtx.Lock()
localNonce, ok := f.pendingMusigNonces[chanID]
if !ok {
Expand Down Expand Up @@ -4124,13 +4135,17 @@ func (f *Manager) handleChannelReady(peer lnpeer.Peer, //nolint:funlen
return
}

log.Debugf("----> ensureInitialForwardingPolicy")

// Before we can add the channel to the peer, we'll need to ensure that
// we have an initial forwarding policy set.
if err := f.ensureInitialForwardingPolicy(chanID, channel); err != nil {
log.Errorf("Unable to ensure initial forwarding policy: %v",
err)
}

log.Debugf("----> AddNewChannel")

err = peer.AddNewChannel(&lnpeer.NewChannel{
OpenChannel: channel,
ChanOpts: chanOpts,
Expand Down

0 comments on commit 2b25a55

Please sign in to comment.