Skip to content

Commit 6ca5128

Browse files
Lagrang3cdecker
authored andcommitted
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.
1 parent b51acf6 commit 6ca5128

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

plugins/renepay/mcf.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1230,6 +1230,8 @@ struct list_data
12301230

12311231
static inline uint64_t pseudorand_interval(uint64_t a, uint64_t b)
12321232
{
1233+
if (a == b)
1234+
return b;
12331235
assert(b > a);
12341236
return a + pseudorand(b - a);
12351237
}

0 commit comments

Comments
 (0)