routing: track amt ranges in mc

This commit is contained in:
Joost Jager committed 2019-11-22 11:17:28 +01:00
1 parent 62f8cca75b
commit cdf1aa5bc1
8 files changed
+320 -229

No files matched your search

+18 -20
View File
@@ -84,10 +84,9 @@ func TestProbabilityEstimatorOneSuccess(t *testing.T) {
ctx := newEstimatorTestContext(t)
ctx.results = map[int]TimedPairResult{
node1: newTimedPairResult(
testTime.Add(-time.Hour),
successPairResult(100),
),
node1: {
SuccessAmt: lnwire.MilliSatoshi(1000),
},
}
// Because of the previous success, this channel keep reporting a high
@@ -108,10 +107,10 @@ func TestProbabilityEstimatorOneFailure(t *testing.T) {
ctx := newEstimatorTestContext(t)
ctx.results = map[int]TimedPairResult{
node1: newTimedPairResult(
testTime.Add(-time.Hour),
failPairResult(0),
),
node1: {
FailTime: testTime.Add(-time.Hour),
FailAmt: lnwire.MilliSatoshi(50),
},
}
// For an untried node, we expected the node probability. The weight for
@@ -131,18 +130,17 @@ func TestProbabilityEstimatorMix(t *testing.T) {
ctx := newEstimatorTestContext(t)
ctx.results = map[int]TimedPairResult{
node1: newTimedPairResult(
testTime.Add(-time.Hour),
successPairResult(100),
),
node2: newTimedPairResult(
testTime.Add(-2*time.Hour),
failPairResult(0),
),
node3: newTimedPairResult(
testTime.Add(-3*time.Hour),
failPairResult(0),
),
node1: {
SuccessAmt: lnwire.MilliSatoshi(1000),
},
node2: {
FailTime: testTime.Add(-2 * time.Hour),
FailAmt: lnwire.MilliSatoshi(50),
},
node3: {
FailTime: testTime.Add(-3 * time.Hour),
FailAmt: lnwire.MilliSatoshi(50),
},
}
// We expect the probability for a previously successful channel to