| 2658 | } |
| 2659 | |
| 2660 | static 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 | |
| 2677 | REGISTER_PAYMENT_MODIFIER(local_channel_hints, void *, NULL, local_channel_hints_cb); |
| 2678 |
nothing calls this directly
no test coverage detected