Commit 83e1ae9
committed
Avoid force-closing 0-conf channels when funding is reorg'd
When we see a funding transaction for one of our chanels reorg'd
out, we worry that its possible we've been double-spent and
immediately force-close the channel to avoid accepting any more
HTLCs on it. This isn't ideal, but is mostly fine as most nodes
require 6 confirmations and 6 block reorgs are exceedingly rare.
However, this isn't so okay for 0-conf channels - in that case we
elected to trust the funder anyway, so reorgs shouldn't worry us.
Still, to handle this correctly we needed to track the old SCID and
ensure our logic is safe across an SCID change. Luckily, we did
that work for splices, and can now take advantage of it here.
Fixes #3836.1 parent 7ca08a9 commit 83e1ae9
File tree
3 files changed
+256
-60
lines changed- lightning/src/ln
3 files changed
+256
-60
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11344 | 11344 | | |
11345 | 11345 | | |
11346 | 11346 | | |
| 11347 | + | |
| 11348 | + | |
11347 | 11349 | | |
11348 | 11350 | | |
11349 | 11351 | | |
| 11352 | + | |
| 11353 | + | |
11350 | 11354 | | |
11351 | 11355 | | |
11352 | 11356 | | |
| |||
11361 | 11365 | | |
11362 | 11366 | | |
11363 | 11367 | | |
11364 | | - | |
11365 | | - | |
11366 | | - | |
| 11368 | + | |
| 11369 | + | |
11367 | 11370 | | |
11368 | | - | |
11369 | | - | |
11370 | | - | |
11371 | | - | |
11372 | | - | |
11373 | | - | |
11374 | | - | |
11375 | | - | |
| 11371 | + | |
| 11372 | + | |
| 11373 | + | |
| 11374 | + | |
| 11375 | + | |
| 11376 | + | |
| 11377 | + | |
| 11378 | + | |
| 11379 | + | |
| 11380 | + | |
| 11381 | + | |
| 11382 | + | |
| 11383 | + | |
| 11384 | + | |
| 11385 | + | |
| 11386 | + | |
| 11387 | + | |
| 11388 | + | |
| 11389 | + | |
| 11390 | + | |
| 11391 | + | |
11376 | 11392 | | |
11377 | 11393 | | |
11378 | 11394 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3224 | 3224 | | |
3225 | 3225 | | |
3226 | 3226 | | |
3227 | | - | |
3228 | | - | |
3229 | | - | |
3230 | | - | |
3231 | | - | |
3232 | | - | |
| 3227 | + | |
| 3228 | + | |
| 3229 | + | |
| 3230 | + | |
| 3231 | + | |
| 3232 | + | |
| 3233 | + | |
3233 | 3234 | | |
3234 | 3235 | | |
3235 | 3236 | | |
| |||
3241 | 3242 | | |
3242 | 3243 | | |
3243 | 3244 | | |
| 3245 | + | |
3244 | 3246 | | |
3245 | 3247 | | |
3246 | 3248 | | |
| |||
3321 | 3323 | | |
3322 | 3324 | | |
3323 | 3325 | | |
3324 | | - | |
3325 | | - | |
3326 | | - | |
3327 | | - | |
3328 | | - | |
3329 | | - | |
3330 | | - | |
3331 | | - | |
| 3326 | + | |
| 3327 | + | |
| 3328 | + | |
| 3329 | + | |
| 3330 | + | |
| 3331 | + | |
| 3332 | + | |
| 3333 | + | |
| 3334 | + | |
| 3335 | + | |
| 3336 | + | |
| 3337 | + | |
| 3338 | + | |
| 3339 | + | |
| 3340 | + | |
3332 | 3341 | | |
3333 | 3342 | | |
3334 | 3343 | | |
| |||
3362 | 3371 | | |
3363 | 3372 | | |
3364 | 3373 | | |
3365 | | - | |
| 3374 | + | |
| 3375 | + | |
| 3376 | + | |
3366 | 3377 | | |
3367 | 3378 | | |
3368 | 3379 | | |
| |||
3414 | 3425 | | |
3415 | 3426 | | |
3416 | 3427 | | |
3417 | | - | |
| 3428 | + | |
3418 | 3429 | | |
3419 | 3430 | | |
3420 | 3431 | | |
| |||
0 commit comments