mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-03 20:44:54 +01:00
5db69f1b41
Changelog-Changed: `fundchannel_cancel` will now succeed even when executed while a `fundchannel_complete` is ongoing; in that case, it will be considered as cancelling the funding *after* the `fundchannel_complete` succeeds. Let me introduce the concept of "Sequential Consistency": All operations on parallel processes form a single total order agreed upon by all processes. So for example, suppose we have parallel invocations of `fundchannel_complete` and `fundchannel_cancel`: +--[fundchannel_complete]--> | --[fundchannel_start]-+ | +--[fundchannel_cancel]----> What "Sequential Consistency" means is that the above parallel operations can be serialized as a single total order as: --[fundchannel_start]--[fundchannel_complete]--[fundchannel_cancel]--> Or: --[fundchannel_start]--[fundchannel_cancel]--[fundchannel_complete]--> In the first case, `fundchannel_complete` succeeds, and the `fundchannel_cancel` invocation also succeeds, sending an `error` to the peer to make them forget the chanel. In the second case, `fundchannel_cancel` succeeds, and the succeeding `fundchannel_complete` invocation fails, since the funding is already cancelled and there is nothing to complete. Note that in both cases, `fundchannel_cancel` **always** succeeds. Unfortunately, prior to this commit, `fundchannel_cancel` could fail with a `Try fundchannel_cancel again` error if the `fundchannel_complete` is ongoing when the `fundchannel_cancel` is initiated. This violates Sequential Consistency, as there is no single total order that would have caused `fundchannel_cancel` to fail. This commit is a minimal patch which just reschedules `fundchannel_cancel` to occur after any `fundchannel_complete` that is ongoing. |
||
---|---|---|
.. | ||
data | ||
plugins | ||
vectors | ||
benchmark.py | ||
conftest.py | ||
db.py | ||
fixtures.py | ||
test_closing.py | ||
test_connection.py | ||
test_db.py | ||
test_gossip.py | ||
test_invoices.py | ||
test_misc.py | ||
test_onion.py | ||
test_pay.py | ||
test_plugin.py | ||
test_wallet.py | ||
utils.py |