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
2018-12-19 14:54:54 +01:00
parent cfd237bf1f
commit ccf4b7feab
4 changed files with 85 additions and 128 deletions

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