core-lightning/tests
ZmnSCPxj jxPCSnmZ 5db69f1b41 lightningd/opening_control.c: Remove 'Try fundchannel_cancel again' error.
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.
2020-06-22 03:15:55 +00:00
..
data migrations: ignore channels that don't have a peer_id 2020-06-17 14:30:41 +02:00
plugins pytest: fix feature mask for EXPERIMENTAL_FEATURES, add wumbo support. 2020-05-26 19:57:29 -05:00
vectors pytest: Add tests for the sphinx onion generation and processing 2020-03-12 10:25:01 +10:30
benchmark.py py-tests: rename 'announce' to 'wait_for_announce' 2018-12-08 15:15:55 -08:00
conftest.py pytest: Pass result to fixtures and keep directories of failed tests 2018-08-07 00:54:19 +00:00
db.py pytest: Have the DB provider search for the postgres binary 2019-09-22 02:03:43 +00:00
fixtures.py pytest: Configure logging in a fixture to match stdout capturing 2020-03-24 09:52:33 +10:30
test_closing.py tests: skip longer htlc tests on valgring+slow machines 2020-05-12 15:46:58 +09:30
test_connection.py lightningd/opening_control.c: Remove 'Try fundchannel_cancel again' error. 2020-06-22 03:15:55 +00:00
test_db.py migrations: ignore channels that don't have a peer_id 2020-06-17 14:30:41 +02:00
test_gossip.py gossipd: return channel_announcement features for listchannels. 2020-05-07 08:44:58 +09:30
test_invoices.py invoice: ignore dead-end heuristic on explicitly specified channels. 2020-04-14 14:13:26 -05:00
test_misc.py pytest: fix feature mask for EXPERIMENTAL_FEATURES, add wumbo support. 2020-05-26 19:57:29 -05:00
test_onion.py pytest: Actually make sure that the direcory exists 2020-03-24 09:52:33 +10:30
test_pay.py pytest: extend timeout for test_payment_duplicate_uncommitted 2020-05-12 21:57:43 +02:00
test_plugin.py pytest: fix feature mask for EXPERIMENTAL_FEATURES, add wumbo support. 2020-05-26 19:57:29 -05:00
test_wallet.py rpc: don't go below feerate_floor when converting vbytes 2020-06-18 14:07:00 +02:00
utils.py features: do not set option_support_large_channel in channel_announcement. 2020-05-26 19:57:29 -05:00