diff --git a/lightningd/opening_control.c b/lightningd/opening_control.c index 22a92107d356..dfda12c2fe6e 100644 --- a/lightningd/opening_control.c +++ b/lightningd/opening_control.c @@ -50,7 +50,8 @@ void json_add_uncommitted_channel(struct json_stream *response, if (peer) { json_add_node_id(response, "peer_id", &peer->id); json_add_bool(response, "peer_connected", peer->connected == PEER_CONNECTED); - json_add_channel_type(response, "channel_type", uc->fc->channel_type); + if (uc->fc->channel_type) + json_add_channel_type(response, "channel_type", uc->fc->channel_type); } json_add_string(response, "state", "OPENINGD"); json_add_string(response, "owner", "lightning_openingd"); @@ -1174,13 +1175,17 @@ static struct command_result *json_fundchannel_start(struct command *cmd, NULL)) return command_param_failed(); - if (ctype && - !cmd->ld->dev_any_channel_type && - !channel_type_accept(tmpctx, - ctype->features, - cmd->ld->our_features)) { - return command_fail(cmd, JSONRPC2_INVALID_PARAMS, - "channel_type not supported"); + if (ctype) { + fc->channel_type = tal_steal(fc, ctype); + if (!cmd->ld->dev_any_channel_type && + !channel_type_accept(tmpctx, + ctype->features, + cmd->ld->our_features)) { + return command_fail(cmd, JSONRPC2_INVALID_PARAMS, + "channel_type not supported"); + } + } else { + fc->channel_type = NULL; } if (push_msat && amount_msat_greater_sat(*push_msat, *amount)) diff --git a/tests/test_connection.py b/tests/test_connection.py index 8eadd6e85cf9..cbf3ad6b6f92 100644 --- a/tests/test_connection.py +++ b/tests/test_connection.py @@ -1953,7 +1953,8 @@ def test_multifunding_one(node_factory, bitcoind): l1.rpc.multifundchannel(destinations, minconf=0) - bitcoind.generate_block(6, wait_for_mempool=1) + mine_funding_to_announce(bitcoind, [l1, l2, l3], num_blocks=6) + for node in [l1, l2, l3]: node.daemon.wait_for_log(r'to CHANNELD_NORMAL') diff --git a/tests/test_gossip.py b/tests/test_gossip.py index bcf5c488e41e..2079efd8b9fe 100644 --- a/tests/test_gossip.py +++ b/tests/test_gossip.py @@ -1671,7 +1671,7 @@ def test_gossip_store_compact_on_load(node_factory, bitcoind): # These appear before we're fully started, so will already in log: l2.daemon.is_in_log(r'gossip_store_compact_offline: 2 deleted, 9 copied') - assert l2.daemon.is_in_log(r'gossip_store: Read 2/4/3/0 cannounce/cupdate/nannounce/cdelete from store \(0 deleted\) in 2016 bytes') + assert l2.daemon.is_in_log(r'gossip_store: Read 2/4/3/0 cannounce/cupdate/nannounce/cdelete from store \(0 deleted\)') def test_gossip_announce_invalid_block(node_factory, bitcoind):