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: |
|
|
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 |
|
|