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

Function local_channel_hints_cb

plugins/libplugin-pay.c:2676–2691  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2674}
2675
2676static struct command_result *local_channel_hints_cb(void *d UNUSED, struct payment *p)
2677{
2678 struct out_req *req;
2679 /* If we are not the root we don't look up the channel balances since
2680 * it is unlikely that the capacities have changed much since the root
2681 * payment looked at them. We also only call `listpeers` when the
2682 * payment is in state PAYMENT_STEP_INITIALIZED, right before calling
2683 * `getroute`. */
2684 if (p->parent != NULL || p->step != PAYMENT_STEP_INITIALIZED)
2685 return payment_continue(p);
2686
2687 req = jsonrpc_request_start(payment_cmd(p), "listpeerchannels",
2688 local_channel_hints_listpeerchannels,
2689 local_channel_hints_listpeerchannels, p);
2690 return send_outreq(req);
2691}
2692
2693REGISTER_PAYMENT_MODIFIER(local_channel_hints, void *, NULL, local_channel_hints_cb);
2694

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