multi: use cache for source channels

This commit is contained in:
Oliver Gugger committed 2021-09-29 17:00:04 +02:00
1 parent 369c09be61
commit 15d3f62d5e
7 files changed
+37 -23

No files matched your search

+3 -3
View File
@@ -710,9 +710,9 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
return nil, err
}
queryBandwidth := func(edge *channeldb.ChannelEdgeInfo) lnwire.MilliSatoshi {
cid := lnwire.NewChanIDFromOutPoint(&edge.ChannelPoint)
link, err := s.htlcSwitch.GetLink(cid)
queryBandwidth := func(c *channeldb.DirectedChannel) lnwire.MilliSatoshi {
cid := lnwire.NewShortChanIDFromInt(c.ChannelID)
link, err := s.htlcSwitch.GetLinkByShortID(cid)
if err != nil {
// If the link isn't online, then we'll report
// that it has zero bandwidth to the router.