mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-15 20:09:18 +01:00
notification: block_added json key updated from block to block_added
Changelog-Added: JSON-RPC: `block_added` notification wraps fields in `block_added` object (notification consistency)
This commit is contained in:
parent
79092c16b1
commit
b9fba1c0b5
3 changed files with 15 additions and 5 deletions
|
@ -888,7 +888,7 @@ throughout the node's life as new blocks appear.
|
|||
|
||||
```json
|
||||
{
|
||||
"block": {
|
||||
"block_added": {
|
||||
"hash": "000000000000000000034bdb3c01652a0aa8f63d32f949313d55af2509f9d245",
|
||||
"height": 753304
|
||||
}
|
||||
|
|
|
@ -423,7 +423,7 @@ Emitted after each block is received from bitcoind, either during the initial sy
|
|||
|
||||
```json
|
||||
{
|
||||
"block": {
|
||||
"block_added": {
|
||||
"hash": "000000000000000000034bdb3c01652a0aa8f63d32f949313d55af2509f9d245",
|
||||
"height": 753304
|
||||
}
|
||||
|
|
|
@ -598,13 +598,23 @@ void notify_balance_snapshot(struct lightningd *ld,
|
|||
plugins_notify(ld->plugins, take(n));
|
||||
}
|
||||
|
||||
static void block_added_notification_serialize(struct json_stream *stream,
|
||||
struct block *block)
|
||||
static void json_add_block_added_fields(struct json_stream *stream,
|
||||
const struct block *block)
|
||||
{
|
||||
json_object_start(stream, "block");
|
||||
json_add_string(stream, "hash",
|
||||
type_to_string(tmpctx, struct bitcoin_blkid, &block->blkid));
|
||||
json_add_u32(stream, "height", block->height);
|
||||
}
|
||||
|
||||
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);
|
||||
json_object_start(stream, "block_added");
|
||||
json_add_block_added_fields(stream, block);
|
||||
json_object_end(stream);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue