mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-27 07:23:25 +00:00
lnworker: catch exceptions raised in decode_msg
This commit is contained in:
parent
6aeab66463
commit
1788e5c1c0
1 changed files with 8 additions and 6 deletions
|
@ -811,6 +811,7 @@ class LNWallet(LNWorker):
|
||||||
if chan.short_channel_id == short_channel_id:
|
if chan.short_channel_id == short_channel_id:
|
||||||
return chan
|
return chan
|
||||||
|
|
||||||
|
@log_exceptions
|
||||||
async def _pay(self, invoice: str, amount_sat: int = None, *,
|
async def _pay(self, invoice: str, amount_sat: int = None, *,
|
||||||
attempts: int = 1,
|
attempts: int = 1,
|
||||||
full_path: LNPaymentPath = None) -> Tuple[bool, List[PaymentAttemptLog]]:
|
full_path: LNPaymentPath = None) -> Tuple[bool, List[PaymentAttemptLog]]:
|
||||||
|
@ -928,12 +929,13 @@ class LNWallet(LNWorker):
|
||||||
assert payload['chain_hash'] == constants.net.rev_genesis_bytes()
|
assert payload['chain_hash'] == constants.net.rev_genesis_bytes()
|
||||||
payload['raw'] = channel_update_typed
|
payload['raw'] = channel_update_typed
|
||||||
except: # FIXME: too broad
|
except: # FIXME: too broad
|
||||||
message_type, payload = decode_msg(channel_update_as_received)
|
try:
|
||||||
payload['raw'] = channel_update_as_received
|
message_type, payload = decode_msg(channel_update_as_received)
|
||||||
# sanity check
|
payload['raw'] = channel_update_as_received
|
||||||
if payload['chain_hash'] != constants.net.rev_genesis_bytes():
|
assert payload['chain_hash'] != constants.net.rev_genesis_bytes()
|
||||||
self.logger.info(f'could not decode channel_update for failed htlc: {channel_update_as_received.hex()}')
|
except:
|
||||||
return True
|
self.logger.info(f'could not decode channel_update for failed htlc: {channel_update_as_received.hex()}')
|
||||||
|
return True
|
||||||
r = self.channel_db.add_channel_update(payload)
|
r = self.channel_db.add_channel_update(payload)
|
||||||
blacklist = False
|
blacklist = False
|
||||||
short_channel_id = ShortChannelID(payload['short_channel_id'])
|
short_channel_id = ShortChannelID(payload['short_channel_id'])
|
||||||
|
|
Loading…
Add table
Reference in a new issue