MCPcopy Create free account
hub / github.com/ElementsProject/lightning / block_added_notify

Function block_added_notify

plugins/offers.c:488–501  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

486};
487
488static struct command_result *block_added_notify(struct command *cmd,
489 const char *buf,
490 const jsmntok_t *params)
491{
492 struct offers_data *od = get_offers_data(cmd->plugin);
493 const char *err = json_scan(cmd, buf, params, "{block_added:{height:%}}",
494 JSON_SCAN(json_to_u32, &od->blockheight));
495 if (err)
496 plugin_err(cmd->plugin, "Failed to parse block_added (%.*s): %s",
497 json_tok_full_len(params),
498 json_tok_full(buf, params),
499 err);
500 return notification_handled(cmd);
501}
502
503static const struct plugin_notification notifications[] = {
504 {

Callers

nothing calls this directly

Calls 6

get_offers_dataFunction · 0.85
plugin_errFunction · 0.70
notification_handledFunction · 0.70
json_scanFunction · 0.50
json_tok_full_lenFunction · 0.50
json_tok_fullFunction · 0.50

Tested by

no test coverage detected