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