commit 5686499eae5d1c410371cf9cf5226cdb2d83774b
parent 1b3f450267892fee5a5d78fdc2aee20650d28da2
Author: ThomasV <thomasv@gitorious>
Date: Sun, 16 Aug 2015 13:50:03 +0200
fix #1400
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/transaction.py b/lib/transaction.py
@@ -541,6 +541,7 @@ class Transaction:
@classmethod
def sweep(klass, privkeys, network, to_address, fee):
inputs = []
+ keypairs = {}
for privkey in privkeys:
pubkey = public_key_from_private_key(privkey)
address = address_from_private_key(privkey)
@@ -557,6 +558,7 @@ class Transaction:
item['signatures'] = [None]
item['num_sig'] = 1
inputs += u
+ keypairs[pubkey] = privkey
if not inputs:
return
@@ -564,7 +566,7 @@ class Transaction:
total = sum(i.get('value') for i in inputs) - fee
outputs = [('address', to_address, total)]
self = klass.from_io(inputs, outputs)
- self.sign({ pubkey:privkey })
+ self.sign(keypairs)
return self
@classmethod