Skip to content

Commit 4eca46d

Browse files
lexe-agenta-mpch
authored andcommitted
lexe-ln: Return error when usable channels but max_sendable is 0
1 parent 7ee8b52 commit 4eca46d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lexe-ln/src/command.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1603,10 +1603,6 @@ mod validate {
16031603
));
16041604
}
16051605

1606-
if amount <= max_sendable {
1607-
return Ok(());
1608-
}
1609-
16101606
// If they have a balance but not enough to exceed the channel reserve,
16111607
// return a dedicated error message, instead of "cannot find route".
16121608
if usable_lightning_balance > Amount::ZERO
@@ -1620,6 +1616,10 @@ mod validate {
16201616
));
16211617
}
16221618

1619+
if amount <= max_sendable {
1620+
return Ok(());
1621+
}
1622+
16231623
// Since we know the recipient, we can compute a more accurate maximum
16241624
// sendable amount to this recipient (i.e. max flow) and expose that to
16251625
// the user as a suggestion.

0 commit comments

Comments
 (0)