diff --git a/electrum/channel_db.py b/electrum/channel_db.py index dc258953a..65809c596 100644 --- a/electrum/channel_db.py +++ b/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. ' diff --git a/electrum/lnpeer.py b/electrum/lnpeer.py index e7f889a30..ee4716340 100644 --- a/electrum/lnpeer.py +++ b/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()}") diff --git a/electrum/lnworker.py b/electrum/lnworker.py index 4a414ab1e..64496bcf2 100644 --- a/electrum/lnworker.py +++ b/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,