1
0

lnpeer: fix json serialization of funding_inputs

This commit is contained in:
ThomasV
2020-02-27 19:51:16 +01:00
parent 8f6fc5917a
commit 15e91169c5
2 changed files with 4 additions and 1 deletions

View File

@@ -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",

View File

@@ -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))