rgb-cln/plugins
Rusty Russell aec307f7ba multifundchannel: fix race where we restart fundchannel.
Disconnecting a peer after openingd fails is not instantaneous:
we abort the open, so openingd sends out a WIRE_ERROR which makes
connectd close the connection.

As a result this test fails often.  The simplest fix is to wait for a
second in multifundchannel before retrying, which is also robust
against behaviour changes if we decide *not* to disconnect in future.

Also make sure that addrhint ownership is correct, since this can
lead to a use-after-free if we filter dests.

```
tests/test_connection.py::test_multifunding_best_effort FAILED                                                    [100%]

======================================================= FAILURES ========================================================
_____________________________________________ test_multifunding_best_effort _____________________________________________

node_factory = <pyln.testing.utils.NodeFactory object at 0x7f6c0c95c1c0>
bitcoind = <pyln.testing.utils.BitcoinD object at 0x7f6c0c92a880>

    @pytest.mark.openchannel('v1')
    @pytest.mark.developer("disconnect=... needs DEVELOPER=1")
    def test_multifunding_best_effort(node_factory, bitcoind):
        '''
        Check that best_effort flag works.
        '''
        disconnects = ["-WIRE_INIT",
                       "-WIRE_ACCEPT_CHANNEL",
                       "-WIRE_FUNDING_SIGNED"]
        l1 = node_factory.get_node()
        l2 = node_factory.get_node()
        l3 = node_factory.get_node(disconnect=disconnects)
        l4 = node_factory.get_node()
    
        l1.fundwallet(2000000)
    
        destinations = [{"id": '{}@localhost:{}'.format(l2.info['id'], l2.port),
                         "amount": 50000},
                        {"id": '{}@localhost:{}'.format(l3.info['id'], l3.port),
                         "amount": 50000},
                        {"id": '{}@localhost:{}'.format(l4.info['id'], l4.port),
                         "amount": 50000}]
    
        for i, d in enumerate(disconnects):
            # Should succeed due to best-effort flag.
>           l1.rpc.multifundchannel(destinations, minchannels=2)

tests/test_connection.py:2070: 
...
>           raise RpcError(method, payload, resp['error'])
E           pyln.client.lightning.RpcError: RPC call failed: method: multifundchannel, payload: {'destinations': [{'id': '022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59@localhost:41023', 'amount': 50000}, {'id': '035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d@localhost:41977', 'amount': 50000}, {'id': '0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199@localhost:34943', 'amount': 50000}], 'minchannels': 2}, error: {'code': 305, 'message': 'Peer not connected at start', 'data': {'id': '0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199', 'method': 'fundchannel_start'}}
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-07-18 20:50:04 -05:00
..
examples cln-plugin: Handle --help invocations better 2022-04-11 15:20:32 +09:30
grpc-plugin cln-plugin: Handle --help invocations better 2022-04-11 15:20:32 +09:30
spender multifundchannel: fix race where we restart fundchannel. 2022-07-18 20:50:04 -05:00
src cln_plugin: Configure "dynamic" field in "getmanifest" message 2022-07-11 11:05:50 +02:00
test Makefile: use a library archive for CCAN 2022-07-17 08:51:02 +09:30
.gitignore Plugin: Add new plugin for SCB, Updated makefile and gitignore as well 2022-07-14 12:24:48 -05:00
Cargo.toml cln-plugin: Implement logging facade adapter for cln plugins 2022-03-10 10:21:41 +10:30
Makefile plugins/commando: basic commando plugin (no runes yet). 2022-07-17 08:51:02 +09:30
README.md doc: fix wording in plugins/README.md 2020-01-06 12:57:59 +01:00
autoclean.c plugin: autoclean fix double free when re-enable, remove xfail mark from test_ 2022-07-16 14:19:05 +09:30
bcli.c common: clean up json routine locations. 2022-07-15 12:24:00 -05:00
chanbackup.c common: clean up json routine locations. 2022-07-15 12:24:00 -05:00
commando.c commando: add rate for maximum successful rune use per minute. 2022-07-17 08:51:02 +09:30
fetchinvoice.c common: clean up json routine locations. 2022-07-15 12:24:00 -05:00
funder.c common: clean up json routine locations. 2022-07-15 12:24:00 -05:00
funder_policy.c daemons: remove unused functions or make static. 2021-12-06 10:05:39 +10:30
funder_policy.h daemons: remove unused functions or make static. 2021-12-06 10:05:39 +10:30
keysend.c common: clean up json routine locations. 2022-07-15 12:24:00 -05:00
libplugin-pay.c pay: Populate the channel hints with either the scid or the alias 2022-07-04 22:14:06 +02:00
libplugin-pay.h pay: Populate the channel hints with either the scid or the alias 2022-07-04 22:14:06 +02:00
libplugin.c libplugin: datastore helpers. 2022-07-17 08:51:02 +09:30
libplugin.h libplugin: datastore helpers. 2022-07-17 08:51:02 +09:30
offers.c decode: support decoding runes. 2022-07-17 08:51:02 +09:30
offers.h common: clean up json routine locations. 2022-07-15 12:24:00 -05:00
offers_inv_hook.c common: clean up json routine locations. 2022-07-15 12:24:00 -05:00
offers_inv_hook.h connectd: restore obs2 onion support. 2022-03-29 10:55:12 +10:30
offers_invreq_hook.c common/json_stream.c: provide explicit json_add_primitive_fmt and json_add_str_fmt routines. 2022-07-15 12:24:00 -05:00
offers_invreq_hook.h connectd: restore obs2 onion support. 2022-03-29 10:55:12 +10:30
offers_offer.c common: clean up json routine locations. 2022-07-15 12:24:00 -05:00
offers_offer.h BOLT12: use point32 instead of pubkey32. 2021-10-08 13:47:30 +02:00
pay.c common: clean up json routine locations. 2022-07-15 12:24:00 -05:00
topology.c common: clean up json routine locations. 2022-07-15 12:24:00 -05:00
txprepare.c common: clean up json routine locations. 2022-07-15 12:24:00 -05:00

README.md

Plugin Directory

Any file in this directory which is executable and whose name only consists of alphanumeric characters, space, '.', '-' or '_' will be automatically loaded when lightningd starts (unless suppressed with commandline options).