Merge pull request #9086 from morehouse/fix_fuzz_probability

routing: skip fuzzing when capacity is 0
This commit is contained in:
Oliver Gugger 2024-09-11 02:34:11 -06:00 committed by GitHub
commit a6e65d49cc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -692,10 +692,11 @@ func FuzzProbability(f *testing.F) {
BimodalConfig: BimodalConfig{BimodalScaleMsat: scale},
}
// We don't start fuzzing at zero, because that would cause an error.
f.Add(uint64(1), uint64(0), uint64(0), uint64(0))
f.Fuzz(func(t *testing.T, capacity, successAmt, failAmt, amt uint64) {
if capacity == 0 {
return
}
_, err := estimator.probabilityFormula(
lnwire.MilliSatoshi(capacity),
lnwire.MilliSatoshi(successAmt),