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

Function wait_and_check_bitcoind

plugins/bcli.c:779–803  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

777}
778
779static 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
805static void memleak_mark_bitcoind(struct plugin *p, struct htable *memtable)
806{

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