Skip to content

Commit 3387bba

Browse files
committed
askrene: don't create 0-msat flow in corner case.
Shouldn't happen, but I can't *prove* it's impossible. Signed-off-by: Rusty Russell <[email protected]>
1 parent 43130a3 commit 3387bba

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

plugins/askrene/refine.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,10 @@ static bool duplicate_one_flow(const struct route_query *rq,
385385
for (size_t i = 0; i < tal_count(*flows); i++) {
386386
struct flow *flow = (*flows)[i], *new_flow;
387387
struct amount_msat max, new_amount;
388+
/* Don't create 0 flow (shouldn't happen, but be sure) */
389+
if (amount_msat_less(flow->delivers, AMOUNT_MSAT(2)))
390+
continue;
391+
388392
if (flow_max_capacity(rq, flow, &max, NULL, NULL)
389393
!= CAPPED_HTLC_MAX)
390394
continue;

0 commit comments

Comments
 (0)