mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-03 20:35:13 +00:00
simplify ChannelDB.on_channel_update
This commit is contained in:
parent
c6f0dbbca4
commit
bea5fd8ba8
2 changed files with 4 additions and 7 deletions
|
@ -816,6 +816,7 @@ class Peer(PrintError):
|
||||||
per_commitment_secret_index = RevocationStore.START_INDEX - 1
|
per_commitment_secret_index = RevocationStore.START_INDEX - 1
|
||||||
per_commitment_point_second = secret_to_pubkey(int.from_bytes(
|
per_commitment_point_second = secret_to_pubkey(int.from_bytes(
|
||||||
get_per_commitment_secret_from_seed(chan.local_state.per_commitment_secret_seed, per_commitment_secret_index), 'big'))
|
get_per_commitment_secret_from_seed(chan.local_state.per_commitment_secret_seed, per_commitment_secret_index), 'big'))
|
||||||
|
# note: if funding_locked was not yet received, we might send it multiple times
|
||||||
self.send_message(gen_msg("funding_locked", channel_id=channel_id, next_per_commitment_point=per_commitment_point_second))
|
self.send_message(gen_msg("funding_locked", channel_id=channel_id, next_per_commitment_point=per_commitment_point_second))
|
||||||
if chan.local_state.funding_locked_received:
|
if chan.local_state.funding_locked_received:
|
||||||
self.mark_open(chan)
|
self.mark_open(chan)
|
||||||
|
|
|
@ -393,14 +393,10 @@ class ChannelDB(JsonDB):
|
||||||
short_channel_id = msg_payload['short_channel_id']
|
short_channel_id = msg_payload['short_channel_id']
|
||||||
if constants.net.rev_genesis_bytes() != msg_payload['chain_hash']:
|
if constants.net.rev_genesis_bytes() != msg_payload['chain_hash']:
|
||||||
return
|
return
|
||||||
# try finding channel in verified db
|
|
||||||
channel_info = self._id_to_channel_info.get(short_channel_id, None)
|
|
||||||
if channel_info is None:
|
|
||||||
# try finding channel in pending db
|
# try finding channel in pending db
|
||||||
channel_info = self.ca_verifier.get_pending_channel_info(short_channel_id)
|
channel_info = self.ca_verifier.get_pending_channel_info(short_channel_id)
|
||||||
if channel_info is None:
|
if channel_info is None:
|
||||||
# try finding channel in verified db, again
|
# try finding channel in verified db
|
||||||
# (maybe this is redundant but this should prevent a race..)
|
|
||||||
channel_info = self._id_to_channel_info.get(short_channel_id, None)
|
channel_info = self._id_to_channel_info.get(short_channel_id, None)
|
||||||
if channel_info is None:
|
if channel_info is None:
|
||||||
self.print_error("could not find", short_channel_id)
|
self.print_error("could not find", short_channel_id)
|
||||||
|
|
Loading…
Add table
Reference in a new issue