Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions lightningd/opening_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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))
Expand Down
3 changes: 2 additions & 1 deletion tests/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down
2 changes: 1 addition & 1 deletion tests/test_gossip.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down