Browse Source
transaction.serialize_output: use namedtuple fields
3.3.3.1
SomberNight
6 years ago
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
1 changed files with
3 additions and
4 deletions
-
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 |
|
|
|