1
0

lnpeer: log both sent and recv msgs; use pubkey for incoming transports

Previously for incoming transports, the diagnostic_name (for log messages)
was just "responder" -- not sufficient to distinguish peers.
We now use the pubkey instead.

For outgoing transports it is f"{host}:{port}" (unchanged).
We could just use the pubkey for both uniformly; but it is quite long, and
it is hard to distinguish them at a glance.
This commit is contained in:
SomberNight
2021-03-29 21:29:51 +02:00
parent 5a3ec45b16
commit f2040b19ea
3 changed files with 25 additions and 5 deletions

View File

@@ -169,7 +169,7 @@ class AbstractChannel(Logger, ABC):
old_state = self._state
if (old_state, state) not in state_transitions:
raise Exception(f"Transition not allowed: {old_state.name} -> {state.name}")
self.logger.debug(f'Setting channel state: {old_state.name} -> {state.name}')
self.logger.debug(f'({self.get_id_for_log()}) Setting channel state: {old_state.name} -> {state.name}')
self._state = state
self.storage['state'] = self._state.name
if self.lnworker: