mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-05 05:15:12 +00:00
set short_channel_id regardless of channel state, because peer might be disconnected
This commit is contained in:
parent
b265212fe6
commit
f4b2644620
1 changed files with 5 additions and 9 deletions
|
@ -274,7 +274,6 @@ class LNWorker(PrintError):
|
||||||
if it's also deep enough, also save to disk.
|
if it's also deep enough, also save to disk.
|
||||||
Returns tuple (mined_deep_enough, num_confirmations).
|
Returns tuple (mined_deep_enough, num_confirmations).
|
||||||
"""
|
"""
|
||||||
assert chan.get_state() in ["OPEN", "OPENING"]
|
|
||||||
lnwatcher = self.network.lnwatcher
|
lnwatcher = self.network.lnwatcher
|
||||||
conf = lnwatcher.get_tx_height(chan.funding_outpoint.txid).conf
|
conf = lnwatcher.get_tx_height(chan.funding_outpoint.txid).conf
|
||||||
if conf > 0:
|
if conf > 0:
|
||||||
|
@ -285,8 +284,8 @@ class LNWorker(PrintError):
|
||||||
chan.short_channel_id = chan.short_channel_id_predicted
|
chan.short_channel_id = chan.short_channel_id_predicted
|
||||||
self.save_channel(chan)
|
self.save_channel(chan)
|
||||||
self.on_channels_updated()
|
self.on_channels_updated()
|
||||||
return True, conf
|
else:
|
||||||
return False, conf
|
self.print_error("funding tx is still not at sufficient depth. actual depth: " + str(conf))
|
||||||
|
|
||||||
def channel_by_txo(self, txo):
|
def channel_by_txo(self, txo):
|
||||||
with self.lock:
|
with self.lock:
|
||||||
|
@ -373,12 +372,9 @@ class LNWorker(PrintError):
|
||||||
if args[0] != lnwatcher:
|
if args[0] != lnwatcher:
|
||||||
return
|
return
|
||||||
for chan in channels:
|
for chan in channels:
|
||||||
if chan.get_state() == "OPENING":
|
if chan.short_channel_id is None:
|
||||||
res, depth = self.save_short_chan_id(chan)
|
self.save_short_chan_id(chan)
|
||||||
if not res:
|
if chan.get_state() == "OPENING" and chan.short_channel_id:
|
||||||
self.print_error("network update but funding tx is still not at sufficient depth. actual depth: " + str(depth))
|
|
||||||
continue
|
|
||||||
# this results in the channel being marked OPEN
|
|
||||||
peer = self.peers[chan.node_id]
|
peer = self.peers[chan.node_id]
|
||||||
peer.send_funding_locked(chan)
|
peer.send_funding_locked(chan)
|
||||||
elif chan.get_state() == "OPEN":
|
elif chan.get_state() == "OPEN":
|
||||||
|
|
Loading…
Add table
Reference in a new issue