Browse Source

make tx.deserialize preserve existing inputs

master
ThomasV 11 years ago
parent
commit
5c2235e54b
  1. 2
      gui/qt/transaction_dialog.py
  2. 3
      lib/transaction.py

2
gui/qt/transaction_dialog.py

@ -45,7 +45,7 @@ class TxDialog(QWidget):
Pass desc to give a description for txs not yet in the wallet. Pass desc to give a description for txs not yet in the wallet.
''' '''
self.tx = tx self.tx = tx
tx_dict = tx.as_dict() self.tx.deserialize()
self.parent = parent self.parent = parent
self.wallet = parent.wallet self.wallet = parent.wallet
self.prompt_if_unsaved = prompt_if_unsaved self.prompt_if_unsaved = prompt_if_unsaved

3
lib/transaction.py

@ -482,6 +482,7 @@ class Transaction:
def __init__(self, raw): def __init__(self, raw):
self.raw = raw self.raw = raw
self.inputs = None
def update(self, raw): def update(self, raw):
self.raw = raw self.raw = raw
@ -518,6 +519,8 @@ class Transaction:
def deserialize(self): def deserialize(self):
if self.inputs is not None:
return
d = deserialize(self.raw) d = deserialize(self.raw)
self.inputs = d['inputs'] self.inputs = d['inputs']
self.outputs = [(x['type'], x['address'], x['value']) for x in d['outputs']] self.outputs = [(x['type'], x['address'], x['value']) for x in d['outputs']]

Loading…
Cancel
Save