lnworker.suggest_splits: (fix) don't force splitting
lnworker.suggest_splits for non-trampoline case tries to split amts over 5000 sat but mpp_split.suggest_splits does not return splits where any part is smaller than 10000 sat. So in practice, without trampoline, invoices between 5k and ~20k sats could not be paid. This suggests that the logic should not be scattered in multiple places but merged into mpp_split.py... This commit just does a quick fix though, to try again without splitting if there was no solution.
This commit is contained in:
@@ -1890,13 +1890,20 @@ class LNWallet(LNWorker):
|
|||||||
if (amount_msat / final_total_msat > self.MPP_SPLIT_PART_FRACTION
|
if (amount_msat / final_total_msat > self.MPP_SPLIT_PART_FRACTION
|
||||||
and amount_msat > self.MPP_SPLIT_PART_MINAMT_MSAT):
|
and amount_msat > self.MPP_SPLIT_PART_MINAMT_MSAT):
|
||||||
exclude_single_part_payments = True
|
exclude_single_part_payments = True
|
||||||
split_configurations = suggest_splits(
|
|
||||||
amount_msat,
|
def get_splits():
|
||||||
channels_with_funds,
|
return suggest_splits(
|
||||||
exclude_single_part_payments=exclude_single_part_payments,
|
amount_msat,
|
||||||
exclude_multinode_payments=exclude_multinode_payments,
|
channels_with_funds,
|
||||||
exclude_single_channel_splits=exclude_single_channel_splits
|
exclude_single_part_payments=exclude_single_part_payments,
|
||||||
)
|
exclude_multinode_payments=exclude_multinode_payments,
|
||||||
|
exclude_single_channel_splits=exclude_single_channel_splits
|
||||||
|
)
|
||||||
|
|
||||||
|
split_configurations = get_splits()
|
||||||
|
if not split_configurations and exclude_single_part_payments:
|
||||||
|
exclude_single_part_payments = False
|
||||||
|
split_configurations = get_splits()
|
||||||
self.logger.info(f'suggest_split {amount_msat} returned {len(split_configurations)} configurations')
|
self.logger.info(f'suggest_split {amount_msat} returned {len(split_configurations)} configurations')
|
||||||
return split_configurations
|
return split_configurations
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user