Skip to content

Commit

Permalink
lightningd: actually deprecate old notification fields now tests and …
Browse files Browse the repository at this point in the history
…plugins are all updated.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Deprecated: JSON-RPC: `connect`, `disconnect` and `block_added` notification fields outside the same-named object (use .connect/.disconnect/.block_added sub-objects)
  • Loading branch information
ShahanaFarooqui authored and rustyrussell committed Jul 10, 2023
1 parent 99b885c commit 1606ef1
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions lightningd/notification.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ static void connect_notification_serialize(struct json_stream *stream,
const struct wireaddr_internal *addr)
{
/* Old style: Add raw fields without connect key */
/* FIXME: Deprecate! */
json_add_connect_fields(stream, nodeid, incoming, addr);
if (deprecated_apis)
json_add_connect_fields(stream, nodeid, incoming, addr);
json_object_start(stream, "connect");
json_add_connect_fields(stream, nodeid, incoming, addr);
json_object_end(stream);
Expand Down Expand Up @@ -94,8 +94,8 @@ static void disconnect_notification_serialize(struct json_stream *stream,
struct node_id *nodeid)
{
/* Old style: Add raw fields without disconnect key */
/* FIXME: deprecate! */
json_add_disconnect_fields(stream, nodeid);
if (deprecated_apis)
json_add_disconnect_fields(stream, nodeid);
json_object_start(stream, "disconnect");
json_add_disconnect_fields(stream, nodeid);
json_object_end(stream);
Expand Down Expand Up @@ -609,10 +609,11 @@ static void json_add_block_added_fields(struct json_stream *stream,
static void block_added_notification_serialize(struct json_stream *stream,
struct block *block)
{
/* FIXME: deprecate! */
json_object_start(stream, "block");
json_add_block_added_fields(stream, block);
json_object_end(stream);
if (deprecated_apis) {
json_object_start(stream, "block");
json_add_block_added_fields(stream, block);
json_object_end(stream);
}
json_object_start(stream, "block_added");
json_add_block_added_fields(stream, block);
json_object_end(stream);
Expand Down

0 comments on commit 1606ef1

Please sign in to comment.