diff --git a/channeld/channeld.c b/channeld/channeld.c index 9777959a6..541f9460c 100644 --- a/channeld/channeld.c +++ b/channeld/channeld.c @@ -2952,7 +2952,7 @@ skip_tlvs: && next_commitment_number == 1) { struct tlv_channel_ready_tlvs *tlvs = tlv_channel_ready_tlvs_new(tmpctx); - status_debug("Retransmitting funding_locked for channel %s", + status_debug("Retransmitting channel_ready for channel %s", type_to_string(tmpctx, struct channel_id, &peer->channel_id)); /* Contains per commit point #1, for first post-opening commit */ msg = towire_channel_ready(NULL, diff --git a/common/billboard.c b/common/billboard.c index 5a1e62542..e67efe4a0 100644 --- a/common/billboard.c +++ b/common/billboard.c @@ -4,7 +4,7 @@ #include char *billboard_message(const tal_t *ctx, - const bool funding_locked[NUM_SIDES], + const bool channel_ready[NUM_SIDES], const bool have_sigs[NUM_SIDES], const bool shutdown_sent[NUM_SIDES], u32 depth_togo, @@ -13,17 +13,17 @@ char *billboard_message(const tal_t *ctx, const char *funding_status, *announce_status, *shutdown_status COMPILER_WANTS_INIT("gcc 8.3.0"); - if (funding_locked[LOCAL] && funding_locked[REMOTE]) - funding_status = "Funding transaction locked."; - else if (!funding_locked[LOCAL] && !funding_locked[REMOTE]) + if (channel_ready[LOCAL] && channel_ready[REMOTE]) + funding_status = "Channel ready for use."; + else if (!channel_ready[LOCAL] && !channel_ready[REMOTE]) funding_status = tal_fmt(ctx, "Funding needs %d more" - " confirmations for lockin.", + " confirmations to be ready.", depth_togo); - else if (funding_locked[LOCAL] && !funding_locked[REMOTE]) - funding_status = "We've confirmed funding, they haven't yet."; - else if (!funding_locked[LOCAL] && funding_locked[REMOTE]) - funding_status = "They've confirmed funding, we haven't yet."; + else if (channel_ready[LOCAL] && !channel_ready[REMOTE]) + funding_status = "We've confirmed channel ready, they haven't yet."; + else if (!channel_ready[LOCAL] && channel_ready[REMOTE]) + funding_status = "They've confirmed channel ready, we haven't yet."; if (have_sigs) { if (have_sigs[LOCAL] && have_sigs[REMOTE]) diff --git a/common/billboard.h b/common/billboard.h index c6d8ded8c..38106e5ff 100644 --- a/common/billboard.h +++ b/common/billboard.h @@ -5,7 +5,7 @@ #include char *billboard_message(const tal_t *ctx, - const bool funding_locked[NUM_SIDES], + const bool channel_ready[NUM_SIDES], const bool have_sigs[NUM_SIDES], const bool shutdown_sent[NUM_SIDES], u32 depth_togo, diff --git a/doc/PLUGINS.md b/doc/PLUGINS.md index 7751f348a..b7e6d17a4 100644 --- a/doc/PLUGINS.md +++ b/doc/PLUGINS.md @@ -441,7 +441,7 @@ if the funding transaction has been included into a block. "id": "03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f", "funding_msat": 100000000, "funding_txid": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b", - "funding_locked": false + "channel_ready": false } } ``` diff --git a/lightningd/dual_open_control.c b/lightningd/dual_open_control.c index a2f84ee61..2a552017c 100644 --- a/lightningd/dual_open_control.c +++ b/lightningd/dual_open_control.c @@ -1790,7 +1790,7 @@ void dualopen_tell_depth(struct subd *dualopend, } else channel_set_billboard(channel, false, tal_fmt(tmpctx, "Funding needs %d more" - " confirmations for lockin.", + " confirmations to be ready.", to_go)); } diff --git a/lightningd/notification.c b/lightningd/notification.c index 82ad1f616..5c0c33981 100644 --- a/lightningd/notification.c +++ b/lightningd/notification.c @@ -201,13 +201,15 @@ static void channel_opened_notification_serialize(struct json_stream *stream, struct node_id *node_id, struct amount_sat *funding_sat, struct bitcoin_txid *funding_txid, - bool funding_locked) + bool channel_ready) { json_object_start(stream, "channel_opened"); json_add_node_id(stream, "id", node_id); json_add_amount_sats_deprecated(stream, "amount", "funding_msat", *funding_sat); json_add_txid(stream, "funding_txid", funding_txid); - json_add_bool(stream, "funding_locked", funding_locked); + if (deprecated_apis) + json_add_bool(stream, "funding_locked", channel_ready); + json_add_bool(stream, "channel_ready", channel_ready); json_object_end(stream); } @@ -216,7 +218,7 @@ REGISTER_NOTIFICATION(channel_opened, void notify_channel_opened(struct lightningd *ld, struct node_id *node_id, struct amount_sat *funding_sat, struct bitcoin_txid *funding_txid, - bool funding_locked) + bool channel_ready) { void (*serialize)(struct json_stream *, struct node_id *, @@ -226,7 +228,7 @@ void notify_channel_opened(struct lightningd *ld, struct node_id *node_id, struct jsonrpc_notification *n = jsonrpc_notification_start(NULL, channel_opened_notification_gen.topic); - serialize(n->stream, node_id, funding_sat, funding_txid, funding_locked); + serialize(n->stream, node_id, funding_sat, funding_txid, channel_ready); jsonrpc_notification_end(n); plugins_notify(ld->plugins, take(n)); } diff --git a/lightningd/notification.h b/lightningd/notification.h index 8eb00c0a3..ab9bddd60 100644 --- a/lightningd/notification.h +++ b/lightningd/notification.h @@ -47,7 +47,7 @@ void notify_invoice_creation(struct lightningd *ld, struct amount_msat *amount, void notify_channel_opened(struct lightningd *ld, struct node_id *node_id, struct amount_sat *funding_sat, struct bitcoin_txid *funding_txid, - bool funding_locked); + bool channel_ready); void notify_channel_state_changed(struct lightningd *ld, struct node_id *peer_id, diff --git a/openingd/dualopend.c b/openingd/dualopend.c index 0c40c0fdc..03e47911c 100644 --- a/openingd/dualopend.c +++ b/openingd/dualopend.c @@ -3620,7 +3620,7 @@ static void do_reconnect_dance(struct state *state) } if (state->channel_ready[LOCAL]) { - status_debug("Retransmitting funding_locked for channel %s", + status_debug("Retransmitting channel_ready for channel %s", type_to_string(tmpctx, struct channel_id, &state->channel_id)); diff --git a/openingd/dualopend_wire.csv b/openingd/dualopend_wire.csv index 7f49f37fe..45defc1f4 100644 --- a/openingd/dualopend_wire.csv +++ b/openingd/dualopend_wire.csv @@ -50,8 +50,8 @@ msgdata,dualopend_reinit,their_basepoints,basepoints, msgdata,dualopend_reinit,remote_per_commit,pubkey, msgdata,dualopend_reinit,funding_psbt,wally_psbt, msgdata,dualopend_reinit,opener,enum side, -msgdata,dualopend_reinit,local_funding_locked,bool, -msgdata,dualopend_reinit,remote_funding_locked,bool, +msgdata,dualopend_reinit,local_channel_ready,bool, +msgdata,dualopend_reinit,remote_channel_ready,bool, msgdata,dualopend_reinit,send_shutdown,bool, msgdata,dualopend_reinit,remote_shutdown_received,bool, msgdata,dualopend_reinit,local_shutdown_len,u16, diff --git a/tests/test_closing.py b/tests/test_closing.py index f278d9c93..f635a17c4 100644 --- a/tests/test_closing.py +++ b/tests/test_closing.py @@ -33,9 +33,9 @@ def test_closing_simple(node_factory, bitcoind, chainparams): assert bitcoind.rpc.getmempoolinfo()['size'] == 0 billboard = only_one(l1.rpc.listpeers(l2.info['id'])['peers'][0]['channels'])['status'] - assert billboard == ['CHANNELD_NORMAL:Funding transaction locked.'] + assert billboard == ['CHANNELD_NORMAL:Channel ready for use.'] billboard = only_one(l2.rpc.listpeers(l1.info['id'])['peers'][0]['channels'])['status'] - assert billboard == ['CHANNELD_NORMAL:Funding transaction locked.'] + assert billboard == ['CHANNELD_NORMAL:Channel ready for use.'] bitcoind.generate_block(5) @@ -44,7 +44,7 @@ def test_closing_simple(node_factory, bitcoind, chainparams): billboard = only_one(l1.rpc.listpeers(l2.info['id'])['peers'][0]['channels'])['status'] # This may either be from a local_update or an announce, so just # check for the substring - assert 'CHANNELD_NORMAL:Funding transaction locked.' in billboard[0] + assert 'CHANNELD_NORMAL:Channel ready for use.' in billboard[0] l1.rpc.close(chan) diff --git a/tests/test_connection.py b/tests/test_connection.py index 3f915c8c6..7040d4dcd 100644 --- a/tests/test_connection.py +++ b/tests/test_connection.py @@ -669,9 +669,9 @@ def test_reconnect_gossiping(node_factory): @pytest.mark.openchannel('v1') @pytest.mark.openchannel('v2') def test_reconnect_no_update(node_factory, executor, bitcoind): - """Test that funding_locked is retransmitted on reconnect if new channel + """Test that channel_ready is retransmitted on reconnect if new channel - This tests if the `funding_locked` is sent if we receive a + This tests if the `channel_ready` is sent if we receive a `channel_reestablish` message with `next_commitment_number` == 1 and our `next_commitment_number` == 1. @@ -689,14 +689,14 @@ def test_reconnect_no_update(node_factory, executor, bitcoind): l1.rpc.connect(l2.info["id"], "localhost", l2.port) # LightningNode.fundchannel will fund the channel and generate a - # block. The block triggers the funding_locked message, which + # block. The block triggers the channel_ready message, which # causes a disconnect. The retransmission is then caused by the # automatic retry. fundchannel_exec = executor.submit(l1.fundchannel, l2, 10**6, False) if l1.config('experimental-dual-fund'): - l1.daemon.wait_for_log(r"dualopend.* Retransmitting funding_locked for channel") + l1.daemon.wait_for_log(r"dualopend.* Retransmitting channel_ready for channel") else: - l1.daemon.wait_for_log(r"channeld.* Retransmitting funding_locked for channel") + l1.daemon.wait_for_log(r"channeld.* Retransmitting channel_ready for channel") sync_blockheight(bitcoind, [l1, l2]) fundchannel_exec.result() l1.stop() @@ -706,7 +706,7 @@ def test_reconnect_no_update(node_factory, executor, bitcoind): # Close will trigger the -WIRE_SHUTDOWN and we then wait for the # automatic reconnection to trigger the retransmission. l1.rpc.close(l2.info['id'], 0) - l2.daemon.wait_for_log(r"channeld.* Retransmitting funding_locked for channel") + l2.daemon.wait_for_log(r"channeld.* Retransmitting channel_ready for channel") l1.daemon.wait_for_log(r"CLOSINGD_COMPLETE") @@ -913,7 +913,7 @@ def test_reconnect_remote_sends_no_sigs(node_factory): # l2 will now uses (REMOTE's) announcement_signatures it has stored wait_for(lambda: only_one(l2.rpc.listpeers()['peers'][0]['channels'])['status'] == [ 'CHANNELD_NORMAL:Reconnected, and reestablished.', - 'CHANNELD_NORMAL:Funding transaction locked. Channel announced.']) + 'CHANNELD_NORMAL:Channel ready for use. Channel announced.']) # But l2 still sends its own sigs on reconnect l2.daemon.wait_for_logs([r'peer_out WIRE_ANNOUNCEMENT_SIGNATURES', diff --git a/tests/test_misc.py b/tests/test_misc.py index 9e656a016..d505820be 100644 --- a/tests/test_misc.py +++ b/tests/test_misc.py @@ -1108,7 +1108,7 @@ def test_funding_reorg_private(node_factory, bitcoind): daemon = 'DUALOPEND' if l1.config('experimental-dual-fund') else 'CHANNELD' wait_for(lambda: only_one(l1.rpc.listpeers()['peers'][0]['channels'])['status'] - == ['{}_AWAITING_LOCKIN:Funding needs 1 more confirmations for lockin.'.format(daemon)]) + == ['{}_AWAITING_LOCKIN:Funding needs 1 more confirmations to be ready.'.format(daemon)]) bitcoind.generate_block(1) # height 107 l1.wait_channel_active('106x1x0') l2.wait_channel_active('106x1x0') @@ -1166,7 +1166,7 @@ def test_funding_reorg_remote_lags(node_factory, bitcoind): wait_for(lambda: only_one(l2.rpc.listpeers()['peers'][0]['channels'])['status'] == [ 'CHANNELD_NORMAL:Reconnected, and reestablished.', - 'CHANNELD_NORMAL:Funding transaction locked. They need our announcement signatures.']) + 'CHANNELD_NORMAL:Channel ready for use. They need our announcement signatures.']) # Unblinding l2 brings it back in sync, restarts channeld and sends its announce sig l2.daemon.rpcproxy.mock_rpc('getblockhash', None) @@ -1176,7 +1176,7 @@ def test_funding_reorg_remote_lags(node_factory, bitcoind): wait_for(lambda: only_one(l2.rpc.listpeers()['peers'][0]['channels'])['status'] == [ 'CHANNELD_NORMAL:Reconnected, and reestablished.', - 'CHANNELD_NORMAL:Funding transaction locked. Channel announced.']) + 'CHANNELD_NORMAL:Channel ready for use. Channel announced.']) l1.rpc.close(l2.info['id']) bitcoind.generate_block(1, True) diff --git a/tests/test_opening.py b/tests/test_opening.py index 7072e8216..207ff5086 100644 --- a/tests/test_opening.py +++ b/tests/test_opening.py @@ -1275,7 +1275,7 @@ def test_zeroconf_mindepth(bitcoind, node_factory): bitcoind.generate_block(2, wait_for_mempool=1) # Confirm on the l2 side. l2.daemon.wait_for_log(r'peer_out WIRE_CHANNEL_READY') - # l1 should not be sending funding_locked/channel_ready yet, it is + # l1 should not be sending channel_ready yet, it is # configured to wait for 6 confirmations. assert not l1.daemon.is_in_log(r'peer_out WIRE_CHANNEL_READY')