forked from lightningdevkit/rust-lightning
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Abort if insufficient liquidity in
pay_for_offer
This commit introduces a check to abort early if there's insufficient liquidity when fulfilling the payment in `pay_for_offer` The logic gets the available liquidity by summing up the `next_outbound_htlc_limit_msat` from all usable channels. Then, compares the total liquidity amount with the total payment amount. If the payment amount is > the available liquidity, the function logs an error and returns a Bolt12SemanticError::InsufficientLiquidity error.
- Loading branch information
Showing
2 changed files
with
23 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters