From 0035e8b99d4a91251dd94531777bd235f1ee3f65 Mon Sep 17 00:00:00 2001 From: Conner Fromknecht Date: Tue, 5 Nov 2019 15:04:24 -0800 Subject: [PATCH 1/4] routing/router: fix double hex encoding of target pubkey --- routing/router.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/routing/router.go b/routing/router.go index ceacd3513..09c259e23 100644 --- a/routing/router.go +++ b/routing/router.go @@ -1404,7 +1404,7 @@ func (r *ChannelRouter) FindRoute(source, target route.Vertex, finalCLTVDelta = finalExpiry[0] } - log.Debugf("Searching for path to %x, sending %v", target, amt) + log.Debugf("Searching for path to %v, sending %v", target, amt) // We can short circuit the routing by opportunistically checking to // see if the target vertex event exists in the current graph. @@ -1847,7 +1847,7 @@ func (r *ChannelRouter) tryApplyChannelUpdate(rt *route.Route, // Apply channel update. if !r.applyChannelUpdate(update, errSource) { - log.Debugf("Invalid channel update received: node=%x", + log.Debugf("Invalid channel update received: node=%v", errVertex) } From 52b3d5bbf7bd967a0bdb48fcb321caa78c77fb13 Mon Sep 17 00:00:00 2001 From: Conner Fromknecht Date: Tue, 5 Nov 2019 15:04:43 -0800 Subject: [PATCH 2/4] fundingmanager: print hex of pending chan id, use snake case --- fundingmanager.go | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/fundingmanager.go b/fundingmanager.go index f33ce498f..d9c483d73 100644 --- a/fundingmanager.go +++ b/fundingmanager.go @@ -678,7 +678,7 @@ func (f *fundingManager) CancelPeerReservations(nodePub [33]byte) { func (f *fundingManager) failFundingFlow(peer lnpeer.Peer, tempChanID [32]byte, fundingErr error) { - fndgLog.Debugf("Failing funding flow for pendingID=%x: %v", + fndgLog.Debugf("Failing funding flow for pending_id=%x: %v", tempChanID, fundingErr) ctx, err := f.cancelReservationCtx(peer.IdentityKey(), tempChanID) @@ -812,7 +812,7 @@ func (f *fundingManager) advanceFundingState(channel *channeldb.OpenChannel, // network. // TODO(halseth): could do graph consistency check // here, and re-add the edge if missing. - fndgLog.Debugf("ChannlPoint(%v) with chanID=%v not "+ + fndgLog.Debugf("ChannelPoint(%v) with chan_id=%x not "+ "found in opening database, assuming already "+ "announced to the network", channel.FundingOutpoint, pendingChanID) @@ -1330,7 +1330,7 @@ func (f *fundingManager) handleFundingOpen(fmsg *fundingOpenMsg) { return } - fndgLog.Infof("Sending fundingResp for pendingID(%x)", + fndgLog.Infof("Sending fundingResp for pending_id(%x)", msg.PendingChannelID) fndgLog.Debugf("Remote party accepted commitment constraints: %v", spew.Sdump(remoteContribution.ChannelConfig.ChannelConstraints)) @@ -1383,7 +1383,7 @@ func (f *fundingManager) handleFundingAccept(fmsg *fundingAcceptMsg) { resCtx, err := f.getReservationCtx(peerKey, pendingChanID) if err != nil { - fndgLog.Warnf("Can't find reservation (peerKey:%v, chanID:%v)", + fndgLog.Warnf("Can't find reservation (peerKey:%v, chan_id:%v)", peerKey, pendingChanID) return } @@ -1391,7 +1391,8 @@ func (f *fundingManager) handleFundingAccept(fmsg *fundingAcceptMsg) { // Update the timestamp once the fundingAcceptMsg has been handled. defer resCtx.updateTimestamp() - fndgLog.Infof("Recv'd fundingResponse for pendingID(%x)", pendingChanID[:]) + fndgLog.Infof("Recv'd fundingResponse for pending_id(%x)", + pendingChanID[:]) // The required number of confirmations should not be greater than the // maximum number of confirmations required by the ChainNotifier to @@ -1500,7 +1501,7 @@ func (f *fundingManager) handleFundingAccept(fmsg *fundingAcceptMsg) { f.signedReservations[channelID] = pendingChanID f.resMtx.Unlock() - fndgLog.Infof("Generated ChannelPoint(%v) for pendingID(%x)", outPoint, + fndgLog.Infof("Generated ChannelPoint(%v) for pending_id(%x)", outPoint, pendingChanID[:]) fundingCreated := &lnwire.FundingCreated{ @@ -1542,7 +1543,7 @@ func (f *fundingManager) handleFundingCreated(fmsg *fundingCreatedMsg) { resCtx, err := f.getReservationCtx(peerKey, pendingChanID) if err != nil { - fndgLog.Warnf("can't find reservation (peerID:%v, chanID:%x)", + fndgLog.Warnf("can't find reservation (peer_id:%v, chan_id:%x)", peerKey, pendingChanID[:]) return } @@ -1553,7 +1554,7 @@ func (f *fundingManager) handleFundingCreated(fmsg *fundingCreatedMsg) { // initiator's commitment transaction, then send our own if it's valid. // TODO(roasbeef): make case (p vs P) consistent throughout fundingOut := fmsg.msg.FundingPoint - fndgLog.Infof("completing pendingID(%x) with ChannelPoint(%v)", + fndgLog.Infof("completing pending_id(%x) with ChannelPoint(%v)", pendingChanID[:], fundingOut) // With all the necessary data available, attempt to advance the @@ -1608,7 +1609,7 @@ func (f *fundingManager) handleFundingCreated(fmsg *fundingCreatedMsg) { f.newChanBarriers[channelID] = make(chan struct{}) f.barrierMtx.Unlock() - fndgLog.Infof("sending FundingSigned for pendingID(%x) over "+ + fndgLog.Infof("sending FundingSigned for pending_id(%x) over "+ "ChannelPoint(%v)", pendingChanID[:], fundingOut) // With their signature for our version of the commitment transaction @@ -1704,8 +1705,8 @@ func (f *fundingManager) handleFundingSigned(fmsg *fundingSignedMsg) { peerKey := fmsg.peer.IdentityKey() resCtx, err := f.getReservationCtx(peerKey, pendingChanID) if err != nil { - fndgLog.Warnf("Unable to find reservation (peerID:%v, chanID:%x)", - peerKey, pendingChanID[:]) + fndgLog.Warnf("Unable to find reservation (peer_id:%v, "+ + "chan_id:%x)", peerKey, pendingChanID[:]) // TODO: add ErrChanNotFound? f.failFundingFlow(fmsg.peer, pendingChanID, err) return @@ -1764,7 +1765,7 @@ func (f *fundingManager) handleFundingSigned(fmsg *fundingSignedMsg) { "arbitration: %v", fundingPoint, err) } - fndgLog.Infof("Finalizing pendingID(%x) over ChannelPoint(%v), "+ + fndgLog.Infof("Finalizing pending_id(%x) over ChannelPoint(%v), "+ "waiting for channel open on-chain", pendingChanID[:], fundingPoint) @@ -1936,7 +1937,7 @@ func (f *fundingManager) waitForFundingConfirmation( } fundingPoint := completeChan.FundingOutpoint - fndgLog.Infof("ChannelPoint(%v) is now active: ChannelID(%x)", + fndgLog.Infof("ChannelPoint(%v) is now active: ChannelID(%v)", fundingPoint, lnwire.NewChanIDFromOutPoint(&fundingPoint)) // With the block height and the transaction index known, we can @@ -2818,7 +2819,7 @@ func (f *fundingManager) handleInitFundingMsg(msg *initFundingMsg) { // reservation throughout its lifetime. chanID := f.nextPendingChanID() - fndgLog.Infof("Target commit tx sat/kw for pendingID(%x): %v", chanID, + fndgLog.Infof("Target commit tx sat/kw for pending_id(%x): %v", chanID, int64(commitFeePerKw)) // If the remote CSV delay was not set in the open channel request, @@ -2868,7 +2869,7 @@ func (f *fundingManager) handleInitFundingMsg(msg *initFundingMsg) { maxValue := f.cfg.RequiredRemoteMaxValue(capacity) maxHtlcs := f.cfg.RequiredRemoteMaxHTLCs(capacity) - fndgLog.Infof("Starting funding workflow with %v for pendingID(%x), "+ + fndgLog.Infof("Starting funding workflow with %v for pending_id(%x), "+ "tweakless=%v", msg.peer.Address(), chanID, tweaklessCommitment) fundingOpen := lnwire.OpenChannel{ @@ -2997,7 +2998,7 @@ func (f *fundingManager) pruneZombieReservations() { for pendingChanID, resCtx := range zombieReservations { err := fmt.Errorf("reservation timed out waiting for peer "+ - "(peerID:%v, chanID:%x)", resCtx.peer.IdentityKey(), + "(peer_id:%v, chan_id:%x)", resCtx.peer.IdentityKey(), pendingChanID[:]) fndgLog.Warnf(err.Error()) f.failFundingFlow(resCtx.peer, pendingChanID, err) From 51627ffe5f7818c66171e9a5170a9eec1371a6e0 Mon Sep 17 00:00:00 2001 From: Conner Fromknecht Date: Tue, 5 Nov 2019 15:05:04 -0800 Subject: [PATCH 3/4] server: fix double hex encoded peer string --- server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server.go b/server.go index b8872e9ef..9ab3885f9 100644 --- a/server.go +++ b/server.go @@ -2915,7 +2915,7 @@ func (s *server) peerTerminationWatcher(p *peer, ready chan struct{}) { // If there were any notification requests for when this peer // disconnected, we can trigger them now. - srvrLog.Debugf("Notifying that peer %x is offline", p) + srvrLog.Debugf("Notifying that peer %v is offline", p) pubStr := string(pubKey.SerializeCompressed()) for _, offlineChan := range s.peerDisconnectedListeners[pubStr] { close(offlineChan) From 8b5f16387c589a9284b2bfb4f0f224dbca66b182 Mon Sep 17 00:00:00 2001 From: Conner Fromknecht Date: Tue, 5 Nov 2019 15:05:20 -0800 Subject: [PATCH 4/4] watchtower/lookout: fix double-hex encoded chainhash --- watchtower/lookout/lookout.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/watchtower/lookout/lookout.go b/watchtower/lookout/lookout.go index fc7baddec..1d9f911b3 100644 --- a/watchtower/lookout/lookout.go +++ b/watchtower/lookout/lookout.go @@ -68,7 +68,7 @@ func (l *Lookout) Start() error { if startEpoch == nil { log.Infof("Starting lookout from chain tip") } else { - log.Infof("Starting lookout from epoch(height=%d hash=%x)", + log.Infof("Starting lookout from epoch(height=%d hash=%v)", startEpoch.Height, startEpoch.Hash) }