| 1244 | } |
| 1245 | |
| 1246 | struct chain_topology *new_topology(struct lightningd *ld, struct logger *log) |
| 1247 | { |
| 1248 | struct chain_topology *topo = tal(ld, struct chain_topology); |
| 1249 | |
| 1250 | topo->ld = ld; |
| 1251 | topo->block_map = new_htable(topo, block_map); |
| 1252 | topo->outgoing_txs = new_htable(topo, outgoing_tx_map); |
| 1253 | topo->txwatches = new_htable(topo, txwatch_hash); |
| 1254 | topo->txowatches = new_htable(topo, txowatch_hash); |
| 1255 | topo->scriptpubkeywatches = new_htable(topo, scriptpubkeywatch_hash); |
| 1256 | topo->blockdepthwatches = new_htable(topo, blockdepthwatch_hash); |
| 1257 | topo->log = log; |
| 1258 | topo->bitcoind = new_bitcoind(topo, ld, log); |
| 1259 | topo->poll_seconds = 30; |
| 1260 | memset(topo->feerates, 0, sizeof(topo->feerates)); |
| 1261 | topo->smoothed_feerates = NULL; |
| 1262 | topo->root = NULL; |
| 1263 | topo->sync_waiters = tal(topo, struct list_head); |
| 1264 | topo->extend_timer = NULL; |
| 1265 | topo->rebroadcast_timer = NULL; |
| 1266 | topo->updatefee_timer = NULL; |
| 1267 | topo->checkchain_timer = NULL; |
| 1268 | topo->request_ctx = tal(topo, char); |
| 1269 | list_head_init(topo->sync_waiters); |
| 1270 | |
| 1271 | return topo; |
| 1272 | } |
| 1273 | |
| 1274 | static bool check_sync(struct bitcoind *bitcoind, |
| 1275 | const u32 headercount, const u32 blockcount, const bool ibd, |
no test coverage detected