multi: use cache for source channels

This commit is contained in:
Oliver Gugger
2021-09-21 19:18:21 +02:00
parent 369c09be61
commit 15d3f62d5e
7 changed files with 37 additions and 23 deletions

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.