mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-03 10:46:58 +01:00
lightningd/notification: use notification name in 'jsonrpc_notification_start()'
That way 'notification_topics' array modification would not lead to unwanted renaming
This commit is contained in:
parent
64b43dd060
commit
f55d29ee49
1 changed files with 5 additions and 5 deletions
|
@ -21,7 +21,7 @@ void notify_connect(struct lightningd *ld, struct node_id *nodeid,
|
|||
struct wireaddr_internal *addr)
|
||||
{
|
||||
struct jsonrpc_notification *n =
|
||||
jsonrpc_notification_start(NULL, notification_topics[0]);
|
||||
jsonrpc_notification_start(NULL, "connect");
|
||||
json_add_node_id(n->stream, "id", nodeid);
|
||||
json_add_address_internal(n->stream, "address", addr);
|
||||
jsonrpc_notification_end(n);
|
||||
|
@ -31,7 +31,7 @@ void notify_connect(struct lightningd *ld, struct node_id *nodeid,
|
|||
void notify_disconnect(struct lightningd *ld, struct node_id *nodeid)
|
||||
{
|
||||
struct jsonrpc_notification *n =
|
||||
jsonrpc_notification_start(NULL, notification_topics[1]);
|
||||
jsonrpc_notification_start(NULL, "disconnect");
|
||||
json_add_node_id(n->stream, "id", nodeid);
|
||||
jsonrpc_notification_end(n);
|
||||
plugins_notify(ld->plugins, take(n));
|
||||
|
@ -42,7 +42,7 @@ void notify_disconnect(struct lightningd *ld, struct node_id *nodeid)
|
|||
void notify_warning(struct lightningd *ld, struct log_entry *l)
|
||||
{
|
||||
struct jsonrpc_notification *n =
|
||||
jsonrpc_notification_start(NULL, notification_topics[2]);
|
||||
jsonrpc_notification_start(NULL, "warning");
|
||||
json_object_start(n->stream, "warning");
|
||||
/* Choose "BROKEN"/"UNUSUAL" to keep consistent with the habit
|
||||
* of plugin. But this may confuses the users who want to 'getlog'
|
||||
|
@ -66,8 +66,8 @@ void notify_invoice_payment(struct lightningd *ld, struct amount_msat amount,
|
|||
struct preimage preimage, const struct json_escape *label)
|
||||
{
|
||||
struct jsonrpc_notification *n =
|
||||
jsonrpc_notification_start(NULL, notification_topics[3]);
|
||||
json_object_start(n->stream, notification_topics[3]);
|
||||
jsonrpc_notification_start(NULL, "invoice_payment");
|
||||
json_object_start(n->stream, "invoice_payment");
|
||||
json_add_string(n->stream, "msat",
|
||||
type_to_string(tmpctx, struct amount_msat, &amount));
|
||||
json_add_hex(n->stream, "preimage", &preimage, sizeof(preimage));
|
||||
|
|
Loading…
Add table
Reference in a new issue