channeldb/graph: always populate LightningNode features
Previously we would return nil features when we didn't have a node announcement or a given node. With this change, we can always assume the feature vector is populated during pathfinding.
This commit is contained in:
parent
9025a30f5d
commit
80802d8e84
@ -3461,6 +3461,10 @@ func deserializeLightningNode(r io.Reader) (LightningNode, error) {
|
||||
err error
|
||||
)
|
||||
|
||||
// Always populate a feature vector, even if we don't have a node
|
||||
// announcement and short circuit below.
|
||||
node.Features = lnwire.EmptyFeatureVector()
|
||||
|
||||
if _, err := r.Read(scratch[:]); err != nil {
|
||||
return LightningNode{}, err
|
||||
}
|
||||
@ -3506,12 +3510,10 @@ func deserializeLightningNode(r io.Reader) (LightningNode, error) {
|
||||
return LightningNode{}, err
|
||||
}
|
||||
|
||||
fv := lnwire.NewFeatureVector(nil, lnwire.Features)
|
||||
err = fv.Decode(r)
|
||||
err = node.Features.Decode(r)
|
||||
if err != nil {
|
||||
return LightningNode{}, err
|
||||
}
|
||||
node.Features = fv
|
||||
|
||||
if _, err := r.Read(scratch[:2]); err != nil {
|
||||
return LightningNode{}, err
|
||||
|
Loading…
Reference in New Issue
Block a user