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:
9 files changed
+39
-61
No files matched your search
@@ -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
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user