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

Function add_tip

lightningd/chaintopology.c:994–1019  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

992}
993
994static void add_tip(struct chain_topology *topo, struct block *b)
995{
996 /* Attach to tip; b is now the tip. */
997 assert(b->height == topo->tip->height + 1);
998 b->prev = topo->tip;
999 topo->tip->next = b; /* FIXME this doesn't seem to be used anywhere */
1000 topo->tip = b;
1001 trace_span_start("wallet_block_add", b);
1002 wallet_block_add(topo->ld->wallet, b);
1003 trace_span_end(b);
1004
1005 trace_span_start("topo_add_utxo", b);
1006 topo_add_utxos(topo, b);
1007 trace_span_end(b);
1008
1009 trace_span_start("topo_update_spends", b);
1010 topo_update_spends(topo, b->full_txs, b->txids, b->height);
1011 trace_span_end(b);
1012
1013 /* Only keep the transactions we care about. */
1014 trace_span_start("filter_block_txs", b);
1015 filter_block_txs(topo, b);
1016 trace_span_end(b);
1017
1018 block_map_add(topo->block_map, b);
1019}
1020
1021static struct block *new_block(struct chain_topology *topo,
1022 struct bitcoin_block *blk,

Callers 1

get_new_blockFunction · 0.85

Calls 5

wallet_block_addFunction · 0.85
trace_span_endFunction · 0.85
topo_add_utxosFunction · 0.85
topo_update_spendsFunction · 0.85
filter_block_txsFunction · 0.85

Tested by

no test coverage detected