Browse Source

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.
master
SomberNight 2 years ago
parent
commit
95c55c542e
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
  1. 21
      electrum/lnworker.py

21
electrum/lnworker.py

@ -1890,13 +1890,20 @@ class LNWallet(LNWorker):
if (amount_msat / final_total_msat > self.MPP_SPLIT_PART_FRACTION
and amount_msat > self.MPP_SPLIT_PART_MINAMT_MSAT):
exclude_single_part_payments = True
split_configurations = suggest_splits(
amount_msat,
channels_with_funds,
exclude_single_part_payments=exclude_single_part_payments,
exclude_multinode_payments=exclude_multinode_payments,
exclude_single_channel_splits=exclude_single_channel_splits
)
def get_splits():
return suggest_splits(
amount_msat,
channels_with_funds,
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')
return split_configurations

Loading…
Cancel
Save