autopilot: move address lookup from heuristic to agent

To avoid having the heuristics deal with (possibly conflicting) address
lookups, we let the agent handle them.
This commit is contained in:
Johan T. Halseth committed 2019-01-08 10:10:59 +01:00
1 parent cfd237bf1f
commit ccf4b7feab
4 files changed
+85 -128

No files matched your search

-20
View File
@@ -287,11 +287,6 @@ func TestConstrainedPrefAttachmentSelectTwoVertexes(t *testing.T) {
"to be %v, instead was %v",
expScore, candidate.Score)
}
if len(candidate.Addrs) == 0 {
t1.Fatalf("expected node to have " +
"available addresses, didn't")
}
}
})
if !success {
@@ -492,11 +487,6 @@ func TestConstrainedPrefAttachmentSelectGreedyAllocation(t *testing.T) {
"of %v, instead got %v",
maxChanSize, candidate.ChanAmt)
}
if len(candidate.Addrs) == 0 {
t1.Fatalf("expected node to have " +
"available addresses, didn't")
}
}
// Imagine a few channels are being opened, and there's
@@ -527,11 +517,6 @@ func TestConstrainedPrefAttachmentSelectGreedyAllocation(t *testing.T) {
"of %v, instead got %v",
remBalance, candidate.ChanAmt)
}
if len(candidate.Addrs) == 0 {
t1.Fatalf("expected node to have " +
"available addresses, didn't")
}
}
})
if !success {
@@ -622,11 +607,6 @@ func TestConstrainedPrefAttachmentSelectSkipNodes(t *testing.T) {
"of %v, instead got %v",
maxChanSize, candidate.ChanAmt)
}
if len(candidate.Addrs) == 0 {
t1.Fatalf("expected node to have " +
"available addresses, didn't")
}
}
// We'll simulate a channel update by adding the nodes