channeldb: take serialized key to fetch lightning node

This prevents inefficient key conversions in a follow up commit that
change the inner pathfinding loop.
This commit is contained in:
Joost Jager
2019-12-18 12:43:18 +01:00
parent 8ce9e15f4a
commit 37d9ee302c
9 changed files with 39 additions and 61 deletions

View File

@ -2089,11 +2089,7 @@ func (r *ChannelRouter) GetChannelByID(chanID lnwire.ShortChannelID) (
//
// NOTE: This method is part of the ChannelGraphSource interface.
func (r *ChannelRouter) FetchLightningNode(node route.Vertex) (*channeldb.LightningNode, error) {
pubKey, err := btcec.ParsePubKey(node[:], btcec.S256())
if err != nil {
return nil, fmt.Errorf("unable to parse raw public key: %v", err)
}
return r.cfg.Graph.FetchLightningNode(pubKey)
return r.cfg.Graph.FetchLightningNode(node)
}
// ForEachNode is used to iterate over every node in router topology.