You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We'd like the LSP fee calculation for a channel opening to be exposed, such that we can to the calculation ourselves. The calculation happens here, but as part of the function open_channel_fee it always does a network request. This is unnecessary latency for us in some situations, when we already have the LSP info.
Namely our use case is about swapping failed swaps back into lightning. In order to prepare a refund, a network request to retrieve the LSP info is required. However, to calculate the payment amount itself, we need the refund TX to know its fee. So since we already had to receive the LSP info before knowing the payment amount (it is required to learn the payment amount), all we can do to calculate the network amount is start a second network call, just to access the fee calculation, which - since we already have the LSP info - could easily be calculated locally. In fact, this local calculation is exactly what we do, by just copying the calculation logic from the Breez-SDK and do it ourselves. But it would be more maintainable if the Breez-SDK exposed that functionality instead.
The text was updated successfully, but these errors were encountered:
To clarify the goal: Ultimately, we aim to fetch the OpeningFeeParams asynchronously in the background and cache them. This way, whenever we need to compute the fees for a specific amount, we can perform the calculation locally without any additional latency caused by a network request.
We'd like the LSP fee calculation for a channel opening to be exposed, such that we can to the calculation ourselves. The calculation happens here, but as part of the function
open_channel_fee
it always does a network request. This is unnecessary latency for us in some situations, when we already have the LSP info.Namely our use case is about swapping failed swaps back into lightning. In order to prepare a refund, a network request to retrieve the LSP info is required. However, to calculate the payment amount itself, we need the refund TX to know its fee. So since we already had to receive the LSP info before knowing the payment amount (it is required to learn the payment amount), all we can do to calculate the network amount is start a second network call, just to access the fee calculation, which - since we already have the LSP info - could easily be calculated locally. In fact, this local calculation is exactly what we do, by just copying the calculation logic from the Breez-SDK and do it ourselves. But it would be more maintainable if the Breez-SDK exposed that functionality instead.
The text was updated successfully, but these errors were encountered: