tfix: do not add zero change - electrum - Electrum Bitcoin wallet
HTML git clone https://git.parazyd.org/electrum
DIR Log
DIR Files
DIR Refs
DIR Submodules
---
DIR commit c657212e5b6b0fc795bc764ea07e8e061959aeba
DIR parent 0a810de898d97ff02bae10c3081d986fa5699119
HTML Author: ThomasV <thomasv@gitorious>
Date: Mon, 8 Sep 2014 20:44:19 +0200
fix: do not add zero change
Diffstat:
M lib/wallet.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
DIR diff --git a/lib/wallet.py b/lib/wallet.py
t@@ -759,7 +759,7 @@ class Abstract_Wallet(object):
# if change is above dust threshold, add a change output.
change_amount = total - ( amount + fee )
- if fixed_fee is not None:
+ if fixed_fee is not None and change_amount > 0:
# Insert the change output at a random position in the outputs
posn = random.randint(0, len(tx.outputs))
tx.outputs[posn:posn] = [( 'address', change_addr, change_amount)]