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

Function local_channel_hints_cb

plugins/libplugin-pay.c:2660–2675  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2658}
2659
2660static struct command_result *local_channel_hints_cb(void *d UNUSED, struct payment *p)
2661{
2662 struct out_req *req;
2663 /* If we are not the root we don't look up the channel balances since
2664 * it is unlikely that the capacities have changed much since the root
2665 * payment looked at them. We also only call `listpeers` when the
2666 * payment is in state PAYMENT_STEP_INITIALIZED, right before calling
2667 * `getroute`. */
2668 if (p->parent != NULL || p->step != PAYMENT_STEP_INITIALIZED)
2669 return payment_continue(p);
2670
2671 req = jsonrpc_request_start(payment_cmd(p), "listpeerchannels",
2672 local_channel_hints_listpeerchannels,
2673 local_channel_hints_listpeerchannels, p);
2674 return send_outreq(req);
2675}
2676
2677REGISTER_PAYMENT_MODIFIER(local_channel_hints, void *, NULL, local_channel_hints_cb);
2678

Callers

nothing calls this directly

Calls 3

payment_cmdFunction · 0.85
payment_continueFunction · 0.70
send_outreqFunction · 0.70

Tested by

no test coverage detected