Commit 7829e26
committed
lightningd: don't disconnect when sending error for unknown channel_reestablish
When a peer sends WIRE_CHANNEL_REESTABLISH for a channel we don't know
about (e.g. dual-funding where we deleted the unsaved channel on
disconnect but the peer saved it in DUALOPEND_OPEN_COMMIT_READY), we
send an error and disconnect. The disconnect races with the error
delivery: the peer's dualopend may not receive the error before the
connection drops, so the channel survives as a transient failure and
the peer retries on every reconnect, creating an infinite loop.
Fix this by sending the error without disconnecting for the
WIRE_CHANNEL_REESTABLISH case, so the peer's dualopend reliably
receives the error and cleans up the stale channel.
Changelog-Fixed: dual-funding reconnect loop when peer doesn't know about a saved channel
Fixes: #8822
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>1 parent 9737ef5 commit 7829e26
1 file changed
Lines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2137 | 2137 | | |
2138 | 2138 | | |
2139 | 2139 | | |
| 2140 | + | |
| 2141 | + | |
| 2142 | + | |
| 2143 | + | |
| 2144 | + | |
| 2145 | + | |
| 2146 | + | |
| 2147 | + | |
| 2148 | + | |
| 2149 | + | |
| 2150 | + | |
| 2151 | + | |
| 2152 | + | |
| 2153 | + | |
| 2154 | + | |
2140 | 2155 | | |
2141 | 2156 | | |
2142 | 2157 | | |
| |||
2162 | 2177 | | |
2163 | 2178 | | |
2164 | 2179 | | |
| 2180 | + | |
| 2181 | + | |
| 2182 | + | |
| 2183 | + | |
| 2184 | + | |
| 2185 | + | |
| 2186 | + | |
| 2187 | + | |
| 2188 | + | |
2165 | 2189 | | |
2166 | 2190 | | |
2167 | 2191 | | |
| |||
0 commit comments