renepay: patch to assertion htlc_total<=known_max

In theory we should not have htlc_total<=known_max.
But for some strange race condition we do sometimes.
Until we find a solution to ensure the correct state
of the uncertainty network we remove the assertion.
Thanks to signed arithmetic and MIN guards, the rest
of the code in linearize_channel can handle the
weird cases with known_max<htlc_total.

Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
This commit is contained in:
Lagrang3
2024-08-14 21:08:33 +01:00
committed by ShahanaFarooqui
parent 680f81f2aa
commit 684d6dff50

View File

@@ -470,8 +470,14 @@ static bool linearize_channel(const struct pay_parameters *params,
return false;
}
assert(
amount_msat_less_eq(extra_half->htlc_total, extra_half->known_max));
/* FIXME: this assertion has been reported to be triggered in issue
* #7535. A quick and dirty solution is to comment it and work-around
* this case. But in principle if we do things the right way we should
* not have htlc_total>known_max. The problem is likely to be
* asynchronous way in which reserved htlcs are removed and known_max is
* updated. */
// assert(
// amount_msat_less_eq(extra_half->htlc_total, extra_half->known_max));
assert(
amount_msat_less_eq(extra_half->known_min, extra_half->known_max));