mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-04 01:36:24 +01:00
Merge pull request #7526 from yyforyongyu/enhanced-logging
multi: add more trace logs regarding link activate flow
This commit is contained in:
commit
3dc4ab736f
4 changed files with 17 additions and 3 deletions
|
@ -1294,7 +1294,7 @@ func (d *AuthenticatedGossiper) sendRemoteBatch(annBatch []msgWithSenders) {
|
||||||
// We'll first attempt to filter out this new message for all peers
|
// We'll first attempt to filter out this new message for all peers
|
||||||
// that have active gossip syncers active.
|
// that have active gossip syncers active.
|
||||||
for pub, syncer := range syncerPeers {
|
for pub, syncer := range syncerPeers {
|
||||||
log.Tracef("Sending messages batch to GossipSyncer(%x)", pub)
|
log.Tracef("Sending messages batch to GossipSyncer(%s)", pub)
|
||||||
syncer.FilterGossipMsgs(annBatch...)
|
syncer.FilterGossipMsgs(annBatch...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -111,7 +111,11 @@ func messageStoreKey(msg lnwire.Message, peerPubKey [33]byte) ([]byte, error) {
|
||||||
|
|
||||||
// AddMessage adds a message to the store for this peer.
|
// AddMessage adds a message to the store for this peer.
|
||||||
func (s *MessageStore) AddMessage(msg lnwire.Message, peerPubKey [33]byte) error {
|
func (s *MessageStore) AddMessage(msg lnwire.Message, peerPubKey [33]byte) error {
|
||||||
// Construct the key for which we'll find this message with in the store.
|
log.Tracef("Adding message of type %v to store for peer %x",
|
||||||
|
msg.MsgType(), peerPubKey)
|
||||||
|
|
||||||
|
// Construct the key for which we'll find this message with in the
|
||||||
|
// store.
|
||||||
msgKey, err := messageStoreKey(msg, peerPubKey)
|
msgKey, err := messageStoreKey(msg, peerPubKey)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -137,6 +141,9 @@ func (s *MessageStore) AddMessage(msg lnwire.Message, peerPubKey [33]byte) error
|
||||||
func (s *MessageStore) DeleteMessage(msg lnwire.Message,
|
func (s *MessageStore) DeleteMessage(msg lnwire.Message,
|
||||||
peerPubKey [33]byte) error {
|
peerPubKey [33]byte) error {
|
||||||
|
|
||||||
|
log.Tracef("Deleting message of type %v from store for peer %x",
|
||||||
|
msg.MsgType(), peerPubKey)
|
||||||
|
|
||||||
// Construct the key for which we'll find this message with in the
|
// Construct the key for which we'll find this message with in the
|
||||||
// store.
|
// store.
|
||||||
msgKey, err := messageStoreKey(msg, peerPubKey)
|
msgKey, err := messageStoreKey(msg, peerPubKey)
|
||||||
|
|
|
@ -710,6 +710,9 @@ func (l *channelLink) syncChanStates() error {
|
||||||
// first message sent MUST be the ChanSync message.
|
// first message sent MUST be the ChanSync message.
|
||||||
select {
|
select {
|
||||||
case msg := <-l.upstream:
|
case msg := <-l.upstream:
|
||||||
|
l.log.Tracef("Received msg=%v from peer(%x)", msg.MsgType(),
|
||||||
|
l.cfg.Peer.PubKey())
|
||||||
|
|
||||||
remoteChanSyncMsg, ok := msg.(*lnwire.ChannelReestablish)
|
remoteChanSyncMsg, ok := msg.(*lnwire.ChannelReestablish)
|
||||||
if !ok {
|
if !ok {
|
||||||
return fmt.Errorf("first message sent to sync "+
|
return fmt.Errorf("first message sent to sync "+
|
||||||
|
|
|
@ -776,7 +776,8 @@ func (p *Brontide) loadActiveChannels(chans []*channeldb.OpenChannel) (
|
||||||
|
|
||||||
chanID := lnwire.NewChanIDFromOutPoint(chanPoint)
|
chanID := lnwire.NewChanIDFromOutPoint(chanPoint)
|
||||||
|
|
||||||
p.log.Infof("loading ChannelPoint(%v)", chanPoint)
|
p.log.Infof("Loading ChannelPoint(%v), isPending=%v",
|
||||||
|
chanPoint, lnChan.IsPending())
|
||||||
|
|
||||||
// Skip adding any permanently irreconcilable channels to the
|
// Skip adding any permanently irreconcilable channels to the
|
||||||
// htlcswitch.
|
// htlcswitch.
|
||||||
|
@ -1318,6 +1319,8 @@ func (ms *msgStream) AddMsg(msg lnwire.Message) {
|
||||||
func waitUntilLinkActive(p *Brontide,
|
func waitUntilLinkActive(p *Brontide,
|
||||||
cid lnwire.ChannelID) htlcswitch.ChannelUpdateHandler {
|
cid lnwire.ChannelID) htlcswitch.ChannelUpdateHandler {
|
||||||
|
|
||||||
|
p.log.Tracef("Waiting for link=%v to be active", cid)
|
||||||
|
|
||||||
// Subscribe to receive channel events.
|
// Subscribe to receive channel events.
|
||||||
//
|
//
|
||||||
// NOTE: If the link is already active by SubscribeChannelEvents, then
|
// NOTE: If the link is already active by SubscribeChannelEvents, then
|
||||||
|
@ -1395,6 +1398,7 @@ func newChanMsgStream(p *Brontide, cid lnwire.ChannelID) *msgStream {
|
||||||
// If the link is still not active and the calling function
|
// If the link is still not active and the calling function
|
||||||
// errored out, just return.
|
// errored out, just return.
|
||||||
if chanLink == nil {
|
if chanLink == nil {
|
||||||
|
p.log.Warnf("Link=%v is not active")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue