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: if outputs:
self._outputs.sort(key = lambda o: (o.value, self.pay_script(o.type, o.address))) self._outputs.sort(key = lambda o: (o.value, self.pay_script(o.type, o.address)))
def serialize_output(self, output): def serialize_output(self, output: TxOutput) -> str:
output_type, addr, amount = output s = int_to_hex(output.value, 8)
s = int_to_hex(amount, 8) script = self.pay_script(output.type, output.address)
script = self.pay_script(output_type, addr)
s += var_int(len(script)//2) s += var_int(len(script)//2)
s += script s += script
return s return s

Loading…
Cancel
Save