Browse Source

transaction.serialize_output: use namedtuple fields

3.3.3.1
SomberNight 6 years ago
parent
commit
8b61d18a9f
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 7
      electrum/transaction.py

7
electrum/transaction.py

@ -1026,10 +1026,9 @@ class Transaction:
if outputs:
self._outputs.sort(key = lambda o: (o.value, self.pay_script(o.type, o.address)))
def serialize_output(self, output):
output_type, addr, amount = output
s = int_to_hex(amount, 8)
script = self.pay_script(output_type, addr)
def serialize_output(self, output: TxOutput) -> str:
s = int_to_hex(output.value, 8)
script = self.pay_script(output.type, output.address)
s += var_int(len(script)//2)
s += script
return s

Loading…
Cancel
Save