| 327 | } |
| 328 | |
| 329 | static void |
| 330 | start_bitcoin_cliv(const tal_t *ctx, |
| 331 | struct command *cmd, |
| 332 | struct command_result *(*process)(struct bitcoin_cli *), |
| 333 | bool nonzero_exit_ok, |
| 334 | enum bitcoind_prio prio, |
| 335 | void *stash, |
| 336 | const char *method, |
| 337 | va_list ap) |
| 338 | { |
| 339 | struct bitcoin_cli *bcli = tal(bitcoind, struct bitcoin_cli); |
| 340 | |
| 341 | bcli->process = process; |
| 342 | bcli->cmd = cmd; |
| 343 | bcli->prio = prio; |
| 344 | |
| 345 | if (nonzero_exit_ok) |
| 346 | bcli->exitstatus = tal(bcli, int); |
| 347 | else |
| 348 | bcli->exitstatus = NULL; |
| 349 | |
| 350 | bcli->args = gather_argsv(bcli, method, ap); |
| 351 | bcli->stash = stash; |
| 352 | |
| 353 | list_add_tail(&bitcoind->pending[bcli->prio], &bcli->list); |
| 354 | next_bcli(bcli->prio); |
| 355 | } |
| 356 | |
| 357 | /* If ctx is non-NULL, and is freed before we return, we don't call process(). |
| 358 | * process returns false() if it's a spurious error, and we should retry. */ |
no test coverage detected