trivial: don't print frequent-case log line in lnpeer.mark_open

This commit is contained in:
SomberNight 2019-11-22 21:37:15 +01:00
parent 268e245322
commit bda9a407d9
No known key found for this signature in database
GPG key ID: B33B5F232C6271E9
2 changed files with 9 additions and 5 deletions

View file

@ -220,10 +220,11 @@ class Channel(Logger):
def set_state(self, state): def set_state(self, state):
""" set on-chain state """ """ set on-chain state """
if (self._state, state) not in state_transitions: old_state = self._state
raise Exception(f"Transition not allowed: {self._state.name} -> {state.name}") if (old_state, state) not in state_transitions:
raise Exception(f"Transition not allowed: {old_state.name} -> {state.name}")
self._state = state self._state = state
self.logger.debug(f'Setting channel state: {state.name}') self.logger.debug(f'Setting channel state: {old_state.name} -> {state.name}')
if self.lnworker: if self.lnworker:
self.lnworker.save_channel(self) self.lnworker.save_channel(self)
self.lnworker.network.trigger_callback('channel', self) self.lnworker.network.trigger_callback('channel', self)

View file

@ -961,8 +961,11 @@ class Peer(Logger):
assert chan.short_channel_id is not None assert chan.short_channel_id is not None
scid = chan.short_channel_id scid = chan.short_channel_id
# only allow state transition from "FUNDED" to "OPEN" # only allow state transition from "FUNDED" to "OPEN"
if chan.get_state() != channel_states.FUNDED: old_state = chan.get_state()
self.logger.info(f"cannot mark open, {chan.get_state()}") if old_state == channel_states.OPEN:
return
if old_state != channel_states.FUNDED:
self.logger.info(f"cannot mark open, current state: {repr(old_state)}")
return return
assert chan.config[LOCAL].funding_locked_received assert chan.config[LOCAL].funding_locked_received
chan.set_state(channel_states.OPEN) chan.set_state(channel_states.OPEN)