mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-19 05:44:12 +01:00
renepay: bugfix situation with htlcmax=htlcmin
In some weird situations it may happen that some channel along the route could have htlcmax=htlcmin, so that the supremum of htlcmin and the infimum of htlcmax are the same number. In that case there is only one allowed amount that can go through that route. Without this patch renepay would not handle correctly this cornercase.
This commit is contained in:
parent
b51acf6a31
commit
6ca5128ab0
@ -1230,6 +1230,8 @@ struct list_data
|
||||
|
||||
static inline uint64_t pseudorand_interval(uint64_t a, uint64_t b)
|
||||
{
|
||||
if (a == b)
|
||||
return b;
|
||||
assert(b > a);
|
||||
return a + pseudorand(b - a);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user