| 784 | } |
| 785 | |
| 786 | static void wait_and_check_bitcoind(struct plugin *p) |
| 787 | { |
| 788 | struct bcli_result *res; |
| 789 | const char **cmd; |
| 790 | |
| 791 | /* Special case: -rpcwait flags go on command line, not stdin */ |
| 792 | cmd = gather_args(bitcoind, NULL, "-rpcwait", "-rpcwaittimeout=30", |
| 793 | "getnetworkinfo", NULL); |
| 794 | res = execute_bitcoin_cli(bitcoind, p, cmd, NULL); |
| 795 | |
| 796 | if (res->exitstatus == 1) |
| 797 | bitcoind_failure(p, |
| 798 | "RPC connection timed out. Could " |
| 799 | "not connect to bitcoind using " |
| 800 | "bitcoin-cli. Is bitcoind running?"); |
| 801 | if (res->exitstatus != 0) |
| 802 | bitcoind_failure(p, |
| 803 | tal_fmt(bitcoind, "%s exited with code %i: %s", |
| 804 | res->args, res->exitstatus, res->output)); |
| 805 | |
| 806 | parse_getnetworkinfo_result(p, res->output); |
| 807 | |
| 808 | tal_free(cmd); |
| 809 | tal_free(res); |
| 810 | } |
| 811 | |
| 812 | static void memleak_mark_bitcoind(struct plugin *p, struct htable *memtable) |
| 813 | { |
no test coverage detected