lnd
lnd copied to clipboard
With watchtower: breached channel does not show in list/pending/closedchannels for unconfirmed justice tx
Background
I had some fun on testnet and breached one of my channels:
- have channel between nodes A and B
- enable watchtower server on node C and use it from node A (node A is client, node C is server)
- have some updates on channel between A and B
- shutdown node A
- restart node B with an old state
- force-close channel from B with old state
- wait for watchtower to broadcast justice transaction
- start node A
As far as I can see the watchtower did exactly what it should do. Node A also realized the breach after the restart.
However, the breached channel does not show up in node A's listchannels / pendingchannels / closedchannels. Currently, the justice transaction is still in the mempool. The recovered amount does not show in node A's walletbalance (neither confirmed nor pending).
Your environment
- version of
lnd: 9572b49922d77e2605cda27f3ddcbe9b21567828 (master 21 Apr 2022) - which operating system (
uname -aon *Nix): Linux home 5.16.2 #1 SMP PREEMPT Thu Jan 20 21:00:54 CET 2022 x86_64 GNU/Linux - version of
btcd,bitcoind, or other backend: bitcoind v22 - any other relevant environment details: TESTNET
Expected behaviour
Breached channel shows up in lncli pendingchannels (or listchannels/closedchannels).
Actual behaviour
It does not show.
It shows up as closed once the justice transaction (broadcast by my watchtower) is confirmed.
Was the breach transaction already confirmed at the point where you looked at listchannels/pendingchannels?
In general lnd doesn't update channel states until the closing transactions have confirmed. Because with Neutrino you wouldn't be able to watch the mempool in the first place.
Yes. Otherwise I think it would still show up in "listchannels".
It shows up as closed once the justice transaction (broadcast by my watchtower) is confirmed.
If I understand the scenario correctly: this is to be expected, we don't watch the mempool for anything other than direct credits to the internal wallet (unconfirmed balanced).
If we wanted to change this, then we'd need to do something like have the tower notify lnd that it did its job. But AFAICT, everything is working as expected: we only act on chain confirmations.
However, the breached channel does not show up in node A's listchannels / pendingchannels / closedchannels
So it's that during the external breach handling (by the tower), the channel looks as if it doesn't exist from lnd's PoV until the justice transaction hits the chain?
So it's that during the external breach handling (by the tower), the channel looks as if it doesn't exist from lnd's PoV until the justice transaction hits the chain?
Yes, exactly. This happens once lnd learns about the breach transaction, I think, but before the justice transaction is confirmed.
I'm perfectly fine with how everything is shown once the justice transaction is confirmed.
Were you able to reliably produce this result? I have not yet been able to re-produce it
I only tried once, sorry.
Closing this issue due to missing reproduction and no activity
Please reeopen. If you want me to reproduce this, just say so. I posted the necessary steps in the issue. @saubyk
@C-Otto - yeah a reproduction would be useful. I tried to repro this last time I looked at it and was unable to