mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-11 22:57:59 +01:00
routing: add logging for routes discarded due to low success probability
Create the ChanIDString function to return a string representation of the route's channel IDs, formatting them in the order they appear in the route (e.g., "chanID1 -> chanID2"). Discarded routes with a success probability lower than the minimum threshold are now logged accordingly when finding a blinded path.
This commit is contained in:
@@ -773,3 +773,19 @@ func (r *Route) String() string {
|
||||
b.String(), r.TotalTimeLock,
|
||||
)
|
||||
}
|
||||
|
||||
// ChanIDString returns the route's channel IDs as a formatted string.
|
||||
func ChanIDString(r *Route) string {
|
||||
var b strings.Builder
|
||||
|
||||
for i, hop := range r.Hops {
|
||||
b.WriteString(fmt.Sprintf("%v",
|
||||
strconv.FormatUint(hop.ChannelID, 10),
|
||||
))
|
||||
if i != len(r.Hops)-1 {
|
||||
b.WriteString(" -> ")
|
||||
}
|
||||
}
|
||||
|
||||
return b.String()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user