Browse Source

lnpeer.reest_chan: allow state transition WE_ARE_TOXIC->WE_ARE_TOXIC

if the remote does not know we are behind, they will try to send us chan_reest

```
 38.52 | W | P/lnpeer.Peer.[LNWallet, 034cd7a09f-ed50cf95] | channel_reestablish (533x1x1): remote is ahead of us! They should force-close. Remote PCP: 03857eabd943eec820d56b94d2f162763294565627cc42c4a0db0e7c6b77da46be
 38.52 | E | P/lnpeer.Peer.[LNWallet, 034cd7a09f-ed50cf95] | Exception in main_loop: Exception('Transition not allowed: WE_ARE_TOXIC -> WE_ARE_TOXIC')
Traceback (most recent call last):
  File "/home/user/wspace/electrum/electrum/util.py", line 1148, in wrapper
    return await func(*args, **kwargs)
  File "/home/user/wspace/electrum/electrum/lnpeer.py", line 426, in wrapper_func
    return await func(self, *args, **kwargs)
  File "/home/user/wspace/electrum/electrum/lnpeer.py", line 440, in main_loop
    async with self.taskgroup as group:
  File "/home/user/.local/lib/python3.10/site-packages/aiorpcx/curio.py", line 297, in __aexit__
    await self.join()
  File "/home/user/wspace/electrum/electrum/util.py", line 1319, in join
    task.result()
  File "/home/user/wspace/electrum/electrum/lnpeer.py", line 1231, in on_channel_reestablish
    chan.set_state(ChannelState.WE_ARE_TOXIC)
  File "/home/user/wspace/electrum/electrum/lnchannel.py", line 215, in set_state
    raise Exception(f"Transition not allowed: {old_state.name} -> {state.name}")
Exception: Transition not allowed: WE_ARE_TOXIC -> WE_ARE_TOXIC
```
master
SomberNight 2 years ago
parent
commit
f808ec911a
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
  1. 1
      electrum/lnchannel.py

1
electrum/lnchannel.py

@ -140,6 +140,7 @@ state_transitions = [
(cs.OPEN, cs.WE_ARE_TOXIC),
(cs.SHUTDOWN, cs.WE_ARE_TOXIC),
(cs.REQUESTED_FCLOSE, cs.WE_ARE_TOXIC),
(cs.WE_ARE_TOXIC, cs.WE_ARE_TOXIC),
#
(cs.FORCE_CLOSING, cs.FORCE_CLOSING), # allow multiple attempts
(cs.FORCE_CLOSING, cs.CLOSED),

Loading…
Cancel
Save