mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-06 05:26:38 +02:00
autopilot/interface+prefattach: scale node scores to range [0.0, 1.0]
To prepare for combinning scores from multiple heuristics, we require the scores returned from the NodeSores API to be in the range [0.0, 1.0]. The prefAttach heuristic is altered to scale the returned scores such that the most connected node in the grpah is given a score of 1.0.
This commit is contained in:
@ -249,8 +249,8 @@ func TestPrefAttachmentSelectTwoVertexes(t *testing.T) {
|
||||
|
||||
// Since each of the nodes has 1 channel, out
|
||||
// of only one channel in the graph, we expect
|
||||
// their score to be 0.5.
|
||||
expScore := float64(0.5)
|
||||
// their score to be 1.0.
|
||||
expScore := float64(1.0)
|
||||
if candidate.Score != expScore {
|
||||
t1.Fatalf("expected candidate score "+
|
||||
"to be %v, instead was %v",
|
||||
|
Reference in New Issue
Block a user