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

Function local_channel_hints_cb

plugins/libplugin-pay.c:2387–2402  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2385}
2386
2387static void local_channel_hints_cb(void *d UNUSED, struct payment *p)
2388{
2389 struct out_req *req;
2390 /* If we are not the root we don't look up the channel balances since
2391 * it is unlikely that the capacities have changed much since the root
2392 * payment looked at them. We also only call `listpeers` when the
2393 * payment is in state PAYMENT_STEP_INITIALIZED, right before calling
2394 * `getroute`. */
2395 if (p->parent != NULL || p->step != PAYMENT_STEP_INITIALIZED)
2396 return payment_continue(p);
2397
2398 req = jsonrpc_request_start(p->plugin, NULL, "listpeers",
2399 local_channel_hints_listpeers,
2400 local_channel_hints_listpeers, p);
2401 send_outreq(p->plugin, req);
2402}
2403
2404REGISTER_PAYMENT_MODIFIER(local_channel_hints, void *, NULL, local_channel_hints_cb);
2405

Callers

nothing calls this directly

Calls 2

payment_continueFunction · 0.85
send_outreqFunction · 0.70

Tested by

no test coverage detected