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

Function payment_waitblockheight_cb

plugins/libplugin-pay.c:282–301  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

280}
281
282static struct command_result *payment_waitblockheight_cb(struct command *cmd,
283 const char *method,
284 const char *buffer,
285 const jsmntok_t *toks,
286 struct payment *p)
287{
288 u32 syncheight;
289 json_scan(tmpctx, buffer, toks, "{blockheight:%}",
290 JSON_SCAN(json_to_u32, &syncheight));
291 paymod_log(p, LOG_DBG, "waitblockheight reports syncheight=%d",
292 syncheight);
293 p->chainlag = p->start_block - syncheight;
294 if (p->chainlag > 0)
295 paymod_log(p, LOG_INFORM,
296 "Starting the payment with chainlag=%d "
297 "(syncheight=%d < headercount=%d)",
298 p->chainlag, syncheight, p->start_block);
299
300 return payment_continue(p);
301}
302
303static struct command_result *
304payment_getblockheight_success(struct command *cmd,

Callers

nothing calls this directly

Calls 3

paymod_logFunction · 0.85
payment_continueFunction · 0.70
json_scanFunction · 0.50

Tested by

no test coverage detected