URI: 
       tMerge pull request #7069 from bitromortac/2102-mpp-split-params - electrum - Electrum Bitcoin wallet
  HTML git clone https://git.parazyd.org/electrum
   DIR Log
   DIR Files
   DIR Refs
   DIR Submodules
       ---
   DIR commit 5dc7b5bffe0925737499ab618746f672f0902e53
   DIR parent 9024419fdcd78dc3740c544cf81578c18ac87f02
  HTML Author: ThomasV <thomasv@electrum.org>
       Date:   Thu, 25 Feb 2021 10:26:01 +0100
       
       Merge pull request #7069 from bitromortac/2102-mpp-split-params
       
       mpp_split: optimize split parameters
       Diffstat:
         M electrum/mpp_split.py               |       6 +++---
         M electrum/tests/test_mpp_split.py    |       7 +++++--
       
       2 files changed, 8 insertions(+), 5 deletions(-)
       ---
   DIR diff --git a/electrum/mpp_split.py b/electrum/mpp_split.py
       t@@ -12,9 +12,9 @@ REDISTRIBUTION_FRACTION = 10
        SPLIT_FRACTION = 10
        
        # these parameters affect the computational work in the probabilistic algorithm
       -STARTING_CONFIGS = 30
       -CANDIDATES_PER_LEVEL = 20
       -REDISTRIBUTE = 5
       +STARTING_CONFIGS = 50
       +CANDIDATES_PER_LEVEL = 10
       +REDISTRIBUTE = 10
        
        
        def unique_hierarchy(hierarchy: Dict[int, List[Dict[bytes, int]]]) -> Dict[int, List[Dict[bytes, int]]]:
   DIR diff --git a/electrum/tests/test_mpp_split.py b/electrum/tests/test_mpp_split.py
       t@@ -13,8 +13,6 @@ class TestMppSplit(ElectrumTestCase):
                super().setUp()
                # to make tests reproducible:
                random.seed(0)
       -        # undo side effect
       -        mpp_split.PART_PENALTY = PART_PENALTY
                self.channels_with_funds = {
                    0: 1_000_000_000,
                    1: 500_000_000,
       t@@ -22,6 +20,11 @@ class TestMppSplit(ElectrumTestCase):
                    3: 101_000_000,
                }
        
       +    def tearDown(self):
       +        super().tearDown()
       +        # undo side effect
       +        mpp_split.PART_PENALTY = PART_PENALTY
       +
            def test_suggest_splits(self):
                with self.subTest(msg="do a payment with the maximal amount spendable over a single channel"):
                    splits = mpp_split.suggest_splits(1_000_000_000, self.channels_with_funds, exclude_single_parts=True)