| 2385 | } |
| 2386 | |
| 2387 | static 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 | |
| 2404 | REGISTER_PAYMENT_MODIFIER(local_channel_hints, void *, NULL, local_channel_hints_cb); |
| 2405 |
nothing calls this directly
no test coverage detected