1
0

ln: don't corrupt channels storage when multiple funding_locked are received

This commit is contained in:
Janus
2018-06-20 10:48:31 +02:00
committed by ThomasV
parent 3f73332817
commit 83c60441cf
2 changed files with 13 additions and 9 deletions

View File

@@ -122,6 +122,8 @@ class LNWorker(PrintError):
self.channels[openchannel.channel_id] = openchannel
for node_id, peer in self.peers.items():
peer.channels = self.channels_for_peer(node_id)
if openchannel.remote_state.next_per_commitment_point == openchannel.remote_state.last_per_commitment_point:
raise Exception("Tried to save channel with next_point == last_point, this should not happen")
dumped = serialize_channels(self.channels)
self.wallet.storage.put("channels", dumped)
self.wallet.storage.write()