URI: 
       ttrivial: don't print frequent-case log line in lnpeer.mark_open - electrum - Electrum Bitcoin wallet
  HTML git clone https://git.parazyd.org/electrum
   DIR Log
   DIR Files
   DIR Refs
   DIR Submodules
       ---
   DIR commit bda9a407d9b7bd1bcf6c5510b09502692c7c4294
   DIR parent 268e2453229d7ea7e0049aa79f36cc17fd94fc6e
  HTML Author: SomberNight <somber.night@protonmail.com>
       Date:   Fri, 22 Nov 2019 21:37:15 +0100
       
       ttrivial: don't print frequent-case log line in lnpeer.mark_open
       
       Diffstat:
         M electrum/lnchannel.py               |       7 ++++---
         M electrum/lnpeer.py                  |       7 +++++--
       
       2 files changed, 9 insertions(+), 5 deletions(-)
       ---
   DIR diff --git a/electrum/lnchannel.py b/electrum/lnchannel.py
       t@@ -220,10 +220,11 @@ class Channel(Logger):
        
            def set_state(self, state):
                """ set on-chain state """
       -        if (self._state, state) not in state_transitions:
       -            raise Exception(f"Transition not allowed: {self._state.name} -> {state.name}")
       +        old_state = self._state
       +        if (old_state, state) not in state_transitions:
       +            raise Exception(f"Transition not allowed: {old_state.name} -> {state.name}")
                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:
                    self.lnworker.save_channel(self)
                    self.lnworker.network.trigger_callback('channel', self)
   DIR diff --git a/electrum/lnpeer.py b/electrum/lnpeer.py
       t@@ -961,8 +961,11 @@ class Peer(Logger):
                assert chan.short_channel_id is not None
                scid = chan.short_channel_id
                # only allow state transition from "FUNDED" to "OPEN"
       -        if chan.get_state() != channel_states.FUNDED:
       -            self.logger.info(f"cannot mark open, {chan.get_state()}")
       +        old_state = 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
                assert chan.config[LOCAL].funding_locked_received
                chan.set_state(channel_states.OPEN)