Browse Source

transaction: call serialize() before deserialization

283
Roman Zeyde 10 years ago
parent
commit
9d0aa737e5
  1. 10
      lib/transaction.py

10
lib/transaction.py

@ -755,14 +755,14 @@ class Transaction:
def has_address(self, addr): def has_address(self, addr):
return (addr in self.get_output_addresses()) or (addr in (tx.get("address") for tx in self.inputs)) return (addr in self.get_output_addresses()) or (addr in (tx.get("address") for tx in self.inputs))
def as_dict(self): def as_dict(self):
if self.raw is None:
self.raw = self.serialize()
self.deserialize() self.deserialize()
import json
out = { out = {
"hex":str(self), 'hex': self.raw,
"complete":self.is_complete() 'complete': self.is_complete()
} }
return out return out

Loading…
Cancel
Save