tfix for empty wallets - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 7dad17bb62218611454ba92cdd481511443d917b DIR parent 9f650e80a36925e96ce5f4740298c033c3e1ec85 HTML Author: ThomasV <thomasv@gitorious> Date: Thu, 8 Dec 2011 09:11:49 +0100 fix for empty wallets Diffstat: M client/electrum.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) --- DIR diff --git a/client/electrum.py b/client/electrum.py t@@ -493,7 +493,8 @@ class Wallet: def choose_tx_inputs( self, amount, fixed_fee ): """ todo: minimize tx size """ - total = fee = 0 + total = 0 + fee = self.fee if fixed_fee is None else fixed_fee inputs = [] for addr in self.addresses: h = self.history.get(addr) t@@ -502,10 +503,7 @@ class Wallet: v = item.get('value') total += v inputs.append((addr, v, item['tx_hash'], item['pos'], item['raw_scriptPubKey'], None, None) ) - if fixed_fee is not None: - fee = fixed_fee - else: - fee = self.fee * len(inputs) + fee = self.fee*len(inputs) if fixed_fee is None else fixed_fee if total >= amount + fee: break if total >= amount + fee: break else: