Browse Source

(trivial) just add some TODOs

patch-4
SomberNight 4 years ago
parent
commit
2c047c72e1
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 3
      electrum/channel_db.py
  2. 2
      electrum/lnpeer.py
  3. 4
      electrum/lnworker.py

3
electrum/channel_db.py

@ -737,7 +737,8 @@ class ChannelDB(SqlDB):
self._channels_for_node[channel_info.node1_id].add(channel_info.short_channel_id)
self._channels_for_node[channel_info.node2_id].add(channel_info.short_channel_id)
self._update_num_policies_for_chan(channel_info.short_channel_id)
self.logger.info(f'load data {len(self._channels)} {len(self._policies)} {len(self._channels_for_node)}')
self.logger.info(f'data loaded. {len(self._channels)} chans. {len(self._policies)} policies. '
f'{len(self._channels_for_node)} nodes.')
self.update_counts()
(nchans_with_0p, nchans_with_1p, nchans_with_2p) = self.get_num_channels_partitioned_by_policy_count()
self.logger.info(f'num_channels_partitioned_by_policy_count. '

2
electrum/lnpeer.py

@ -1574,6 +1574,8 @@ class Peer(Logger):
# TODO: we should check that all trampoline_onions are the same
return None, processed_onion.trampoline_onion_packet
# TODO don't accept payments twice for same invoice
# TODO check invoice expiry
info = self.lnworker.get_payment_info(htlc.payment_hash)
if info is None:
log_fail_reason(f"no payment_info found for RHASH {htlc.payment_hash.hex()}")

4
electrum/lnworker.py

@ -1210,7 +1210,7 @@ class LNWallet(LNWorker):
failure_msg = htlc_log.failure_msg
code, data = failure_msg.code, failure_msg.data
self.logger.info(f"UPDATE_FAIL_HTLC. code={repr(code)}. "
f"decoded_data={failure_msg.decode_data()}. data={data.hex()}")
f"decoded_data={failure_msg.decode_data()}. data={data.hex()!r}")
self.logger.info(f"error reported by {bh2u(route[sender_idx].node_id)}")
if code == OnionFailureCode.MPP_TIMEOUT:
raise PaymentFailure(failure_msg.code_name())
@ -1274,6 +1274,8 @@ class LNWallet(LNWorker):
sender_idx: int,
failure_msg: OnionRoutingFailure) -> None:
code, data = failure_msg.code, failure_msg.data
# TODO can we use lnmsg.OnionWireSerializer here?
# TODO update onion_wire.csv
# handle some specific error codes
failure_codes = {
OnionFailureCode.TEMPORARY_CHANNEL_FAILURE: 0,

Loading…
Cancel
Save