| 2674 | } |
| 2675 | |
| 2676 | static 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 | |
| 2693 | REGISTER_PAYMENT_MODIFIER(local_channel_hints, void *, NULL, local_channel_hints_cb); |
| 2694 |
nothing calls this directly
no test coverage detected