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 committed 2019-12-19 12:44:00 +01:00
1 parent 8ce9e15f4a
commit 37d9ee302c
9 files changed
+39 -61

No files matched your search

+6 -1
View File
@@ -3369,7 +3369,12 @@ func computeNextBackoff(currBackoff time.Duration) time.Duration {
// fetchNodeAdvertisedAddr attempts to fetch an advertised address of a node.
func (s *server) fetchNodeAdvertisedAddr(pub *btcec.PublicKey) (net.Addr, error) {
node, err := s.chanDB.ChannelGraph().FetchLightningNode(pub)
vertex, err := route.NewVertexFromBytes(pub.SerializeCompressed())
if err != nil {
return nil, err
}
node, err := s.chanDB.ChannelGraph().FetchLightningNode(vertex)
if err != nil {
return nil, err
}