| 2903 | } |
| 2904 | |
| 2905 | static struct command_result *getchaininfo_done(struct command *aux_cmd, |
| 2906 | const char *method, |
| 2907 | const char *buf, |
| 2908 | const jsmntok_t *result, |
| 2909 | void *unused) |
| 2910 | { |
| 2911 | struct xpay *xpay = xpay_of(aux_cmd->plugin); |
| 2912 | |
| 2913 | /* We use headercount from the backend, in case we're still syncing */ |
| 2914 | if (!json_to_u32(buf, json_get_member(buf, result, "headercount"), |
| 2915 | &xpay->blockheight)) { |
| 2916 | plugin_err(aux_cmd->plugin, "Bad getchaininfo '%.*s'", |
| 2917 | json_tok_full_len(result), |
| 2918 | json_tok_full(buf, result)); |
| 2919 | } |
| 2920 | return aux_command_done(aux_cmd); |
| 2921 | } |
| 2922 | |
| 2923 | static struct command_result *getinfo_done(struct command *aux_cmd, |
| 2924 | const char *method, |
nothing calls this directly
no test coverage detected