commit 020702968230606c60564a4ec03fd2c53d65675f
parent f9dad74e13b3979322e25d9e37b56c553662f4e0
Author: ThomasV <thomasv@gitorious>
Date: Wed, 9 Jul 2014 21:21:47 +0200
fix: new outputs format and payment requests
Diffstat:
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/paymentrequest.py b/lib/paymentrequest.py
@@ -249,7 +249,7 @@ class PaymentRequest:
for o in pay_det.outputs:
addr = transaction.get_address_from_output_script(o.script)[1]
- self.outputs.append( (addr, o.amount) )
+ self.outputs.append( ('address', addr, o.amount) )
self.memo = self.details.memo
@@ -269,7 +269,7 @@ class PaymentRequest:
return self.details.expires
def get_amount(self):
- return sum(map(lambda x:x[1], self.outputs))
+ return sum(map(lambda x:x[2], self.outputs))
def get_domain(self):
return self.domain
@@ -294,7 +294,7 @@ class PaymentRequest:
paymnt.transactions.append(raw_tx)
ref_out = paymnt.refund_to.add()
- ref_out.script = transaction.Transaction.pay_script(refund_addr)
+ ref_out.script = transaction.Transaction.pay_script('address', refund_addr)
paymnt.memo = "Paid using Electrum"
pm = paymnt.SerializeToString()
diff --git a/lib/transaction.py b/lib/transaction.py
@@ -522,7 +522,7 @@ class Transaction:
pubkey = public_key_from_private_key(privkey)
address = address_from_private_key(privkey)
u = network.synchronous_get([ ('blockchain.address.listunspent',[address])])[0]
- pay_script = klass.pay_script(address)
+ pay_script = klass.pay_script('address', address)
for item in u:
item['scriptPubKey'] = pay_script
item['redeemPubkey'] = pubkey