MCPcopy Create free account
hub / github.com/ElementsProject/lightning / wait_and_check_bitcoind

Function wait_and_check_bitcoind

plugins/bcli.c:786–810  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

784}
785
786static 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
812static void memleak_mark_bitcoind(struct plugin *p, struct htable *memtable)
813{

Callers 1

initFunction · 0.85

Calls 5

execute_bitcoin_cliFunction · 0.85
bitcoind_failureFunction · 0.85
tal_freeFunction · 0.85
gather_argsFunction · 0.70

Tested by

no test coverage detected