lnworker: improve route creation
- Separates the trampoline and local routing multi-part payment cases. - Ask only for splits that don't send over a single channel (those have been tried already in the single-part case). - Makes sure that create_routes_for_payment only yields partial routes that belong to a single split configuration. - Tracks trampoline fee levels on a per node basis, previously, in the case of having two channels with a trampoline forwarder, the global fee level would have increased by two levels upon first try.
This commit is contained in:
@@ -122,3 +122,7 @@ class TestMppSplit(ElectrumTestCase):
|
||||
mpp_split.PART_PENALTY = 0.3
|
||||
splits = mpp_split.suggest_splits(1_000_000_000, channels_with_funds, exclude_single_part_payments=False)
|
||||
self.assertEqual(3, len(splits[0].config[(0, 0)]))
|
||||
with self.subTest(msg="exclude all single channel splits"):
|
||||
mpp_split.PART_PENALTY = 0.3
|
||||
splits = mpp_split.suggest_splits(1_000_000_000, channels_with_funds, exclude_single_channel_splits=True)
|
||||
self.assertEqual(1, len(splits[0].config[(0, 0)]))
|
||||
|
||||
Reference in New Issue
Block a user