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

Function bcli_failure

plugins/bcli.c:211–239  ·  view source on GitHub ↗

We allow 60 seconds of spurious errors, eg. reorg. */

Source from the content-addressed store, hash-verified

209
210/* We allow 60 seconds of spurious errors, eg. reorg. */
211static void bcli_failure(struct bitcoin_cli *bcli,
212 int exitstatus)
213{
214 struct timerel t;
215
216 if (!bitcoind->error_count)
217 bitcoind->first_error_time = time_mono();
218
219 t = timemono_between(time_mono(), bitcoind->first_error_time);
220 if (time_greater(t, time_from_sec(bitcoind->retry_timeout)))
221 plugin_err(bcli->cmd->plugin,
222 "%s exited %u (after %u other errors) '%.*s'; "
223 "we have been retrying command for "
224 "--bitcoin-retry-timeout=%"PRIu64" seconds; "
225 "bitcoind setup or our --bitcoin-* configs broken?",
226 bcli_args(bcli),
227 exitstatus,
228 bitcoind->error_count,
229 (int)bcli->output_bytes,
230 bcli->output,
231 bitcoind->retry_timeout);
232
233 plugin_log(bcli->cmd->plugin, LOG_UNUSUAL, "%s exited with status %u",
234 bcli_args(bcli), exitstatus);
235 bitcoind->error_count++;
236
237 /* Retry in 1 second */
238 plugin_timer(bcli->cmd->plugin, time_from_sec(1), retry_bcli, bcli);
239}
240
241static void bcli_finished(struct io_conn *conn UNUSED, struct bitcoin_cli *bcli)
242{

Callers 1

bcli_finishedFunction · 0.85

Calls 8

time_monoFunction · 0.85
timemono_betweenFunction · 0.85
time_greaterFunction · 0.85
time_from_secFunction · 0.85
bcli_argsFunction · 0.85
plugin_errFunction · 0.70
plugin_logFunction · 0.70
plugin_timerClass · 0.70

Tested by

no test coverage detected