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

Function new_topology

lightningd/chaintopology.c:1246–1272  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1244}
1245
1246struct 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
1274static bool check_sync(struct bitcoind *bitcoind,
1275 const u32 headercount, const u32 blockcount, const bool ibd,

Callers 1

new_lightningdFunction · 0.70

Calls 2

list_head_initFunction · 0.85
new_bitcoindFunction · 0.70

Tested by

no test coverage detected