Merge pull request #3667 from cfromknecht/log-fixes

fundingmanager+routing log touch ups
This commit is contained in:
Johan T. Halseth 2019-11-20 15:57:05 +01:00 committed by GitHub
commit 8755a35860
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 20 deletions

@ -678,7 +678,7 @@ func (f *fundingManager) CancelPeerReservations(nodePub [33]byte) {
func (f *fundingManager) failFundingFlow(peer lnpeer.Peer, tempChanID [32]byte, func (f *fundingManager) failFundingFlow(peer lnpeer.Peer, tempChanID [32]byte,
fundingErr error) { fundingErr error) {
fndgLog.Debugf("Failing funding flow for pendingID=%x: %v", fndgLog.Debugf("Failing funding flow for pending_id=%x: %v",
tempChanID, fundingErr) tempChanID, fundingErr)
ctx, err := f.cancelReservationCtx(peer.IdentityKey(), tempChanID) ctx, err := f.cancelReservationCtx(peer.IdentityKey(), tempChanID)
@ -812,7 +812,7 @@ func (f *fundingManager) advanceFundingState(channel *channeldb.OpenChannel,
// network. // network.
// TODO(halseth): could do graph consistency check // TODO(halseth): could do graph consistency check
// here, and re-add the edge if missing. // 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 "+ "found in opening database, assuming already "+
"announced to the network", "announced to the network",
channel.FundingOutpoint, pendingChanID) channel.FundingOutpoint, pendingChanID)
@ -1330,7 +1330,7 @@ func (f *fundingManager) handleFundingOpen(fmsg *fundingOpenMsg) {
return return
} }
fndgLog.Infof("Sending fundingResp for pendingID(%x)", fndgLog.Infof("Sending fundingResp for pending_id(%x)",
msg.PendingChannelID) msg.PendingChannelID)
fndgLog.Debugf("Remote party accepted commitment constraints: %v", fndgLog.Debugf("Remote party accepted commitment constraints: %v",
spew.Sdump(remoteContribution.ChannelConfig.ChannelConstraints)) spew.Sdump(remoteContribution.ChannelConfig.ChannelConstraints))
@ -1383,7 +1383,7 @@ func (f *fundingManager) handleFundingAccept(fmsg *fundingAcceptMsg) {
resCtx, err := f.getReservationCtx(peerKey, pendingChanID) resCtx, err := f.getReservationCtx(peerKey, pendingChanID)
if err != nil { 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) peerKey, pendingChanID)
return return
} }
@ -1391,7 +1391,8 @@ func (f *fundingManager) handleFundingAccept(fmsg *fundingAcceptMsg) {
// Update the timestamp once the fundingAcceptMsg has been handled. // Update the timestamp once the fundingAcceptMsg has been handled.
defer resCtx.updateTimestamp() 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 // The required number of confirmations should not be greater than the
// maximum number of confirmations required by the ChainNotifier to // maximum number of confirmations required by the ChainNotifier to
@ -1500,7 +1501,7 @@ func (f *fundingManager) handleFundingAccept(fmsg *fundingAcceptMsg) {
f.signedReservations[channelID] = pendingChanID f.signedReservations[channelID] = pendingChanID
f.resMtx.Unlock() f.resMtx.Unlock()
fndgLog.Infof("Generated ChannelPoint(%v) for pendingID(%x)", outPoint, fndgLog.Infof("Generated ChannelPoint(%v) for pending_id(%x)", outPoint,
pendingChanID[:]) pendingChanID[:])
fundingCreated := &lnwire.FundingCreated{ fundingCreated := &lnwire.FundingCreated{
@ -1542,7 +1543,7 @@ func (f *fundingManager) handleFundingCreated(fmsg *fundingCreatedMsg) {
resCtx, err := f.getReservationCtx(peerKey, pendingChanID) resCtx, err := f.getReservationCtx(peerKey, pendingChanID)
if err != nil { 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[:]) peerKey, pendingChanID[:])
return return
} }
@ -1553,7 +1554,7 @@ func (f *fundingManager) handleFundingCreated(fmsg *fundingCreatedMsg) {
// initiator's commitment transaction, then send our own if it's valid. // initiator's commitment transaction, then send our own if it's valid.
// TODO(roasbeef): make case (p vs P) consistent throughout // TODO(roasbeef): make case (p vs P) consistent throughout
fundingOut := fmsg.msg.FundingPoint fundingOut := fmsg.msg.FundingPoint
fndgLog.Infof("completing pendingID(%x) with ChannelPoint(%v)", fndgLog.Infof("completing pending_id(%x) with ChannelPoint(%v)",
pendingChanID[:], fundingOut) pendingChanID[:], fundingOut)
// With all the necessary data available, attempt to advance the // 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.newChanBarriers[channelID] = make(chan struct{})
f.barrierMtx.Unlock() f.barrierMtx.Unlock()
fndgLog.Infof("sending FundingSigned for pendingID(%x) over "+ fndgLog.Infof("sending FundingSigned for pending_id(%x) over "+
"ChannelPoint(%v)", pendingChanID[:], fundingOut) "ChannelPoint(%v)", pendingChanID[:], fundingOut)
// With their signature for our version of the commitment transaction // With their signature for our version of the commitment transaction
@ -1704,8 +1705,8 @@ func (f *fundingManager) handleFundingSigned(fmsg *fundingSignedMsg) {
peerKey := fmsg.peer.IdentityKey() peerKey := fmsg.peer.IdentityKey()
resCtx, err := f.getReservationCtx(peerKey, pendingChanID) resCtx, err := f.getReservationCtx(peerKey, pendingChanID)
if err != nil { if err != nil {
fndgLog.Warnf("Unable to find reservation (peerID:%v, chanID:%x)", fndgLog.Warnf("Unable to find reservation (peer_id:%v, "+
peerKey, pendingChanID[:]) "chan_id:%x)", peerKey, pendingChanID[:])
// TODO: add ErrChanNotFound? // TODO: add ErrChanNotFound?
f.failFundingFlow(fmsg.peer, pendingChanID, err) f.failFundingFlow(fmsg.peer, pendingChanID, err)
return return
@ -1764,7 +1765,7 @@ func (f *fundingManager) handleFundingSigned(fmsg *fundingSignedMsg) {
"arbitration: %v", fundingPoint, err) "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[:], "waiting for channel open on-chain", pendingChanID[:],
fundingPoint) fundingPoint)
@ -1936,7 +1937,7 @@ func (f *fundingManager) waitForFundingConfirmation(
} }
fundingPoint := completeChan.FundingOutpoint 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)) fundingPoint, lnwire.NewChanIDFromOutPoint(&fundingPoint))
// With the block height and the transaction index known, we can // 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. // reservation throughout its lifetime.
chanID := f.nextPendingChanID() 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)) int64(commitFeePerKw))
// If the remote CSV delay was not set in the open channel request, // 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) maxValue := f.cfg.RequiredRemoteMaxValue(capacity)
maxHtlcs := f.cfg.RequiredRemoteMaxHTLCs(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) "tweakless=%v", msg.peer.Address(), chanID, tweaklessCommitment)
fundingOpen := lnwire.OpenChannel{ fundingOpen := lnwire.OpenChannel{
@ -2997,7 +2998,7 @@ func (f *fundingManager) pruneZombieReservations() {
for pendingChanID, resCtx := range zombieReservations { for pendingChanID, resCtx := range zombieReservations {
err := fmt.Errorf("reservation timed out waiting for peer "+ 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[:]) pendingChanID[:])
fndgLog.Warnf(err.Error()) fndgLog.Warnf(err.Error())
f.failFundingFlow(resCtx.peer, pendingChanID, err) f.failFundingFlow(resCtx.peer, pendingChanID, err)

@ -1407,7 +1407,7 @@ func (r *ChannelRouter) FindRoute(source, target route.Vertex,
finalCLTVDelta = finalExpiry[0] 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 // We can short circuit the routing by opportunistically checking to
// see if the target vertex event exists in the current graph. // see if the target vertex event exists in the current graph.
@ -1854,7 +1854,7 @@ func (r *ChannelRouter) tryApplyChannelUpdate(rt *route.Route,
// Apply channel update. // Apply channel update.
if !r.applyChannelUpdate(update, errSource) { if !r.applyChannelUpdate(update, errSource) {
log.Debugf("Invalid channel update received: node=%x", log.Debugf("Invalid channel update received: node=%v",
errVertex) errVertex)
} }

@ -2919,7 +2919,7 @@ func (s *server) peerTerminationWatcher(p *peer, ready chan struct{}) {
// If there were any notification requests for when this peer // If there were any notification requests for when this peer
// disconnected, we can trigger them now. // 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()) pubStr := string(pubKey.SerializeCompressed())
for _, offlineChan := range s.peerDisconnectedListeners[pubStr] { for _, offlineChan := range s.peerDisconnectedListeners[pubStr] {
close(offlineChan) close(offlineChan)

@ -68,7 +68,7 @@ func (l *Lookout) Start() error {
if startEpoch == nil { if startEpoch == nil {
log.Infof("Starting lookout from chain tip") log.Infof("Starting lookout from chain tip")
} else { } 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) startEpoch.Height, startEpoch.Hash)
} }