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

Function handle_channel_hint_update

plugins/pay.c:1143–1161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1141}
1142
1143static struct command_result *handle_channel_hint_update(struct command *cmd,
1144 const char *buf,
1145 const jsmntok_t *param)
1146{
1147 struct channel_hint *hint = channel_hint_from_json(NULL, buf, param);
1148
1149 plugin_log(cmd->plugin, LOG_DBG,
1150 "Received a channel_hint {.scid = %s, .enabled = %d, "
1151 ".estimate = %s, .capacity = %s }",
1152 fmt_short_channel_id_dir(tmpctx, &hint->scid), hint->enabled,
1153 fmt_amount_msat(tmpctx, hint->estimated_capacity),
1154 fmt_amount_msat(tmpctx, hint->capacity)
1155 );
1156 channel_hint_set_add(global_hints, clock_time().ts.tv_sec, &hint->scid,
1157 hint->enabled, &hint->estimated_capacity,
1158 hint->capacity, NULL);
1159 tal_free(hint);
1160 return notification_handled(cmd);
1161}
1162
1163static const struct plugin_command commands[] = {
1164 {

Callers

nothing calls this directly

Calls 8

channel_hint_from_jsonFunction · 0.85
fmt_short_channel_id_dirFunction · 0.85
channel_hint_set_addFunction · 0.85
clock_timeFunction · 0.85
tal_freeFunction · 0.85
plugin_logFunction · 0.70
notification_handledFunction · 0.70
fmt_amount_msatFunction · 0.50

Tested by

no test coverage detected