Workaround for c-lightning to wait bitcoin core to start
Some checks failed
Continuous Integration / Smoke Test ${{ matrix.cfg }} (32, make-32-bit-nodev-check, 0, make check-source check-units installcheck) (push) Has been cancelled
Continuous Integration / Smoke Test ${{ matrix.cfg }} (make, make) (push) Has been cancelled
Continuous Integration / Smoke Test ${{ matrix.cfg }} (make-EXPERIMENTAL-check, 1, make check-source check-units installcheck check-gen-updated) (push) Has been cancelled
Continuous Integration / Smoke Test ${{ matrix.cfg }} (make-O3-check, -O3, make check-source check-units installcheck check-gen-updated) (push) Has been cancelled
Continuous Integration / Normal Test Config ${{ matrix.cfg }} (arm32v7, cross-arm32, arm-linux-gnueabihf) (push) Has been cancelled
Continuous Integration / Protocol Test Config (clang, sqlite3) (push) Has been cancelled
Continuous Integration / Protocol Test Config (gcc, postgres) (push) Has been cancelled
Continuous Integration / Normal Test Config ${{ matrix.cfg }} (DUAL_FUND, 0, 1, 1) (push) Has been cancelled
Continuous Integration / Normal Test Config ${{ matrix.cfg }} (EXPERIMENTAL, 1) (push) Has been cancelled
Continuous Integration / Normal Test Config ${{ matrix.cfg }} (Elements, liquid-regtest) (push) Has been cancelled
Continuous Integration / Normal Test Config ${{ matrix.cfg }} (PostgreSQL, postgres, 2) (push) Has been cancelled
Continuous Integration / Normal Test Config ${{ matrix.cfg }} (arm64v8, cross-arm64, aarch64-linux-gnu) (push) Has been cancelled
Continuous Integration / Normal Test Config ${{ matrix.cfg }} (check-dbstmts, gcc, 1) (push) Has been cancelled
Continuous Integration / Normal Test Config ${{ matrix.cfg }} (clang-fuzzing, clang, 1) (push) Has been cancelled
Continuous Integration / Normal Test Config ${{ matrix.cfg }} (non-DEVELOPER-non-COMPAT-1, 0, 0, 1, 2) (push) Has been cancelled
Continuous Integration / Normal Test Config ${{ matrix.cfg }} (non-DEVELOPER-non-COMPAT-2, 0, 0, 2, 2) (push) Has been cancelled
Continuous Integration / Valgrind Test Config ${{ matrix.cfg }} (valgrind-1, 3, 1, 10, 1) (push) Has been cancelled
Continuous Integration / Valgrind Test Config ${{ matrix.cfg }} (valgrind-10, 3, 10, 10, 1) (push) Has been cancelled
Continuous Integration / Valgrind Test Config ${{ matrix.cfg }} (valgrind-2, 3, 2, 10, 1) (push) Has been cancelled
Continuous Integration / Valgrind Test Config ${{ matrix.cfg }} (valgrind-3, 3, 3, 10, 1) (push) Has been cancelled
Continuous Integration / Valgrind Test Config ${{ matrix.cfg }} (valgrind-4, 3, 4, 10, 1) (push) Has been cancelled
Continuous Integration / Valgrind Test Config ${{ matrix.cfg }} (valgrind-5, 3, 5, 10, 1) (push) Has been cancelled
Continuous Integration / Valgrind Test Config ${{ matrix.cfg }} (valgrind-6, 3, 6, 10, 1) (push) Has been cancelled
Continuous Integration / Valgrind Test Config ${{ matrix.cfg }} (valgrind-7, 3, 7, 10, 1) (push) Has been cancelled
Continuous Integration / Valgrind Test Config ${{ matrix.cfg }} (valgrind-8, 3, 8, 10, 1) (push) Has been cancelled
Continuous Integration / Valgrind Test Config ${{ matrix.cfg }} (valgrind-9, 3, 9, 10, 1) (push) Has been cancelled

This commit is contained in:
nicolas.dorier 2021-01-26 20:25:02 +09:00 committed by Kukks
parent e540b6b275
commit 4b1f088763

View File

@ -801,6 +801,7 @@ static void wait_and_check_bitcoind(struct plugin *p)
pid_t child;
const char **cmd = gather_args(bitcoind, "getnetworkinfo", NULL);
bool printed = false;
bool isWarmup = false;
char *output = NULL;
for (;;) {
@ -830,17 +831,20 @@ static void wait_and_check_bitcoind(struct plugin *p)
/* bitcoin/src/rpc/protocol.h:
* RPC_IN_WARMUP = -28, //!< Client still warming up
*/
if (WEXITSTATUS(status) != 28) {
if (WEXITSTATUS(status) == 1)
bitcoind_failure(p, "Could not connect to bitcoind using"
" bitcoin-cli. Is bitcoind running?");
bitcoind_failure(p, tal_fmt(bitcoind, "%s exited with code %i: %s",
cmd[0], WEXITSTATUS(status), output));
}
isWarmup = WEXITSTATUS(status) == 28;
if (!printed) {
plugin_log(p, LOG_UNUSUAL,
"Waiting for bitcoind to warm up...");
if (isWarmup)
{
plugin_log(p, LOG_UNUSUAL,
"Waiting for bitcoind to warm up...");
}
else
{
plugin_log(p, LOG_UNUSUAL,
tal_fmt(bitcoind, "%s exited with code %i: %s... retrying",
cmd[0], WEXITSTATUS(status), output));
}
printed = true;
}
sleep(1);