diff --git a/plugins/topology.c b/plugins/topology.c index 8b9ad3d0a711..665072b2e9cb 100644 --- a/plugins/topology.c +++ b/plugins/topology.c @@ -394,7 +394,7 @@ static struct command_result *listpeerchannels_done(struct command *cmd, struct gossmap_localmods *mods; /* In deprecated mode, re-add private channels */ - if (command_deprecated_in_ok(cmd, "include_private", "v24.02", "v24.08")) { + if (command_deprecated_out_ok(cmd, "include_private", "v24.02", "v24.08")) { connected = local_connected(opts, buf, result); mods = gossmods_from_listpeerchannels(tmpctx, &local_id, buf, result, false, diff --git a/tests/test_plugin.py b/tests/test_plugin.py index 97c2c6d8e6de..1c527741f983 100644 --- a/tests/test_plugin.py +++ b/tests/test_plugin.py @@ -4415,3 +4415,10 @@ def test_sql_crash(node_factory, bitcoind): assert 'updates' not in only_one(l1.rpc.listpeerchannels()['channels']) l1.rpc.sql(f"SELECT * FROM peerchannels;") + + +def test_listchannels_broken_message(node_factory): + """This gave a bogus BROKEN message with deprecated-apis enabled""" + l1 = node_factory.get_node(options={'allow-deprecated-apis': True}) + + l1.rpc.listchannels()