| 280 | } |
| 281 | |
| 282 | static struct command_result *payment_waitblockheight_cb(struct command *cmd, |
| 283 | const char *method, |
| 284 | const char *buffer, |
| 285 | const jsmntok_t *toks, |
| 286 | struct payment *p) |
| 287 | { |
| 288 | u32 syncheight; |
| 289 | json_scan(tmpctx, buffer, toks, "{blockheight:%}", |
| 290 | JSON_SCAN(json_to_u32, &syncheight)); |
| 291 | paymod_log(p, LOG_DBG, "waitblockheight reports syncheight=%d", |
| 292 | syncheight); |
| 293 | p->chainlag = p->start_block - syncheight; |
| 294 | if (p->chainlag > 0) |
| 295 | paymod_log(p, LOG_INFORM, |
| 296 | "Starting the payment with chainlag=%d " |
| 297 | "(syncheight=%d < headercount=%d)", |
| 298 | p->chainlag, syncheight, p->start_block); |
| 299 | |
| 300 | return payment_continue(p); |
| 301 | } |
| 302 | |
| 303 | static struct command_result * |
| 304 | payment_getblockheight_success(struct command *cmd, |
nothing calls this directly
no test coverage detected