From 15e91169c508f8681fd4b369be8b80ac11d426bf Mon Sep 17 00:00:00 2001 From: ThomasV Date: Thu, 27 Feb 2020 19:51:16 +0100 Subject: [PATCH] lnpeer: fix json serialization of funding_inputs --- electrum/lnpeer.py | 2 +- electrum/transaction.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/electrum/lnpeer.py b/electrum/lnpeer.py index e3db8dca9..53071cbda 100644 --- a/electrum/lnpeer.py +++ b/electrum/lnpeer.py @@ -594,7 +594,7 @@ class Peer(Logger): sweep_address=self.lnworker.sweep_address, lnworker=self.lnworker, initial_feerate=feerate) - chan.storage['funding_inputs'] = [txin.prevout for txin in funding_tx.inputs()] + chan.storage['funding_inputs'] = [txin.prevout.to_json() for txin in funding_tx.inputs()] sig_64, _ = chan.sign_next_commitment() self.temp_id_to_id[temp_channel_id] = channel_id self.send_message("funding_created", diff --git a/electrum/transaction.py b/electrum/transaction.py index af7789d34..e777611a4 100644 --- a/electrum/transaction.py +++ b/electrum/transaction.py @@ -180,6 +180,9 @@ class TxOutpoint(NamedTuple): def to_str(self) -> str: return f"{self.txid.hex()}:{self.out_idx}" + def to_json(self) -> str: + return [self.txid.hex(), self.out_idx] + def serialize_to_network(self) -> bytes: return self.txid[::-1] + bfh(int_to_hex(self.out_idx, 4))