| 1323 | } |
| 1324 | |
| 1325 | static bool check_sync(struct bitcoind *bitcoind, |
| 1326 | const u32 headercount, const u32 blockcount, const bool ibd, |
| 1327 | struct chain_topology *topo, bool first_call) |
| 1328 | { |
| 1329 | topo->headercount = headercount; |
| 1330 | |
| 1331 | if (ibd) { |
| 1332 | if (first_call) |
| 1333 | log_unusual(bitcoind->log, |
| 1334 | "Waiting for initial block download (this can take" |
| 1335 | " a while!)"); |
| 1336 | else |
| 1337 | log_debug(bitcoind->log, |
| 1338 | "Still waiting for initial block download"); |
| 1339 | } else if (headercount != blockcount) { |
| 1340 | if (first_call) |
| 1341 | log_unusual(bitcoind->log, |
| 1342 | "Waiting for bitcoind to catch up" |
| 1343 | " (%u blocks of %u)", |
| 1344 | blockcount, headercount); |
| 1345 | else |
| 1346 | log_debug(bitcoind->log, |
| 1347 | "Waiting for bitcoind to catch up" |
| 1348 | " (%u blocks of %u)", |
| 1349 | blockcount, headercount); |
| 1350 | } else { |
| 1351 | bitcoind->synced = true; |
| 1352 | return true; |
| 1353 | } |
| 1354 | return false; |
| 1355 | } |
| 1356 | |
| 1357 | /* Loop to see if bitcoind is synced */ |
| 1358 | static void retry_sync(struct chain_topology *topo); |
no outgoing calls
no test coverage detected