mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-12 22:22:36 +02:00
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:
@ -7,7 +7,6 @@ import (
|
||||
"math"
|
||||
"time"
|
||||
|
||||
"github.com/btcsuite/btcd/btcec"
|
||||
"github.com/coreos/bbolt"
|
||||
"github.com/lightningnetwork/lnd/channeldb"
|
||||
"github.com/lightningnetwork/lnd/feature"
|
||||
@ -447,12 +446,7 @@ func findPath(g *graphParams, r *RestrictParams, cfg *PathFindingConfig,
|
||||
// we have for the target node from our graph.
|
||||
features := r.DestFeatures
|
||||
if features == nil {
|
||||
targetKey, err := btcec.ParsePubKey(target[:], btcec.S256())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
targetNode, err := g.graph.FetchLightningNode(targetKey)
|
||||
targetNode, err := g.graph.FetchLightningNode(target)
|
||||
switch {
|
||||
|
||||
// If the node exists and has features, use them directly.
|
||||
|
Reference in New Issue
Block a user