mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-27 14:11:04 +02:00
multi: add logs to debug potential payment sending issue
This commit is contained in:
@@ -2229,6 +2229,9 @@ func (s *Switch) GetLinkByShortID(chanID lnwire.ShortChannelID) (ChannelLink,
|
||||
func (s *Switch) getLinkByShortID(chanID lnwire.ShortChannelID) (ChannelLink, error) {
|
||||
link, ok := s.forwardingIndex[chanID]
|
||||
if !ok {
|
||||
log.Debugf("Link not found in forwarding index using "+
|
||||
"chanID=%v", chanID)
|
||||
|
||||
return nil, ErrChannelLinkNotFound
|
||||
}
|
||||
|
||||
|
@@ -91,7 +91,10 @@ func (b *bandwidthManager) getBandwidth(cid lnwire.ShortChannelID,
|
||||
if err != nil {
|
||||
// If the link isn't online, then we'll report that it has
|
||||
// zero bandwidth.
|
||||
log.Warnf("ShortChannelID=%v: link not found: %v", cid, err)
|
||||
log.Warnf("ShortChannelID=%v: link not found when "+
|
||||
"determining bandwidth for local channel=%v, "+
|
||||
"reporting 0 bandwidth", cid, err)
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
|
@@ -514,7 +514,18 @@ func getOutgoingBalance(node route.Vertex, outgoingChans map[uint64]struct{},
|
||||
|
||||
var max, total lnwire.MilliSatoshi
|
||||
cb := func(channel *graphdb.DirectedChannel) error {
|
||||
shortID := lnwire.NewShortChanIDFromInt(channel.ChannelID)
|
||||
|
||||
// This log line is needed to debug issues in case we do not
|
||||
// have a channel in our graph for some reason when evaluating
|
||||
// the local balance. Otherwise we could not tell whether all
|
||||
// channels are being evaluated.
|
||||
log.Tracef("Evaluating channel %v for local balance", shortID)
|
||||
|
||||
if !channel.OutPolicySet {
|
||||
log.Debugf("ShortChannelID=%v: has no out policy set, "+
|
||||
"skipping", shortID)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -536,6 +547,12 @@ func getOutgoingBalance(node route.Vertex, outgoingChans map[uint64]struct{},
|
||||
// we've already queried the bandwidth hints.
|
||||
if !ok {
|
||||
bandwidth = lnwire.NewMSatFromSatoshis(channel.Capacity)
|
||||
|
||||
log.Warnf("ShortChannelID=%v: not found in the local "+
|
||||
"channels map of the bandwidth manager, "+
|
||||
"using channel capacity=%v as bandwidth for "+
|
||||
"this channel", shortID, bandwidth,
|
||||
)
|
||||
}
|
||||
|
||||
if bandwidth > max {
|
||||
@@ -545,6 +562,9 @@ func getOutgoingBalance(node route.Vertex, outgoingChans map[uint64]struct{},
|
||||
var overflow bool
|
||||
total, overflow = overflowSafeAdd(total, bandwidth)
|
||||
if overflow {
|
||||
log.Warnf("ShortChannelID=%v: overflow detected, "+
|
||||
"setting total to max value", shortID)
|
||||
|
||||
// If the current total and the bandwidth would
|
||||
// overflow the maximum value, we set the total to the
|
||||
// maximum value. Which is more milli-satoshis than are
|
||||
|
@@ -280,8 +280,9 @@ func (u *edgeUnifier) getEdgeLocal(netAmtReceived lnwire.MilliSatoshi,
|
||||
edge.policy.ChannelID, amt,
|
||||
)
|
||||
if !ok {
|
||||
log.Debugf("Cannot get bandwidth for edge %v, use max "+
|
||||
log.Warnf("Cannot get bandwidth for edge %v, use max "+
|
||||
"instead", edge.policy.ChannelID)
|
||||
|
||||
bandwidth = lnwire.MaxMilliSatoshi
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user