URI: 
       tspeedup fee computation when collecting small inputs - electrum - Electrum Bitcoin wallet
  HTML git clone https://git.parazyd.org/electrum
   DIR Log
   DIR Files
   DIR Refs
   DIR Submodules
       ---
   DIR commit 6232a0b76cc041126af62b628394020115cbace0
   DIR parent 8a3e5032b1b0f65dc192c2f821a9fe8b8c9aef13
  HTML Author: ThomasV <thomasv@gitorious>
       Date:   Sat, 15 Aug 2015 10:02:47 +0200
       
       speedup fee computation when collecting small inputs
       
       Diffstat:
         M lib/wallet.py                       |       5 +++--
       
       1 file changed, 3 insertions(+), 2 deletions(-)
       ---
   DIR diff --git a/lib/wallet.py b/lib/wallet.py
       t@@ -893,9 +893,10 @@ class Abstract_Wallet(object):
        
                fee_per_kb = self.fee_per_kb(config)
                amount = sum(map(lambda x:x[2], outputs))
       -        total = fee = 0
       +        total = 0
                inputs = []
                tx = Transaction.from_io(inputs, outputs)
       +        fee = fixed_fee if fixed_fee is not None else 0
                # add old inputs first
                for item in coins:
                    v = item.get('value')
       t@@ -903,7 +904,7 @@ class Abstract_Wallet(object):
                    self.add_input_info(item)
                    tx.add_input(item)
                    # no need to estimate fee until we have reached desired amount
       -            if total < amount:
       +            if total < amount + fee:
                        continue
                    fee = fixed_fee if fixed_fee is not None else self.estimated_fee(tx, fee_per_kb)
                    if total >= amount + fee: