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

Function add_tip

lightningd/chaintopology.c:1009–1034  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1007}
1008
1009static void add_tip(struct chain_topology *topo, struct block *b)
1010{
1011 /* Attach to tip; b is now the tip. */
1012 assert(b->height == topo->tip->height + 1);
1013 b->prev = topo->tip;
1014 topo->tip->next = b; /* FIXME this doesn't seem to be used anywhere */
1015 topo->tip = b;
1016 trace_span_start("wallet_block_add", b);
1017 wallet_block_add(topo->ld->wallet, b);
1018 trace_span_end(b);
1019
1020 trace_span_start("topo_add_utxo", b);
1021 topo_add_utxos(topo, b);
1022 trace_span_end(b);
1023
1024 trace_span_start("topo_update_spends", b);
1025 topo_update_spends(topo, b->full_txs, b->txids, b->height);
1026 trace_span_end(b);
1027
1028 /* Only keep the transactions we care about. */
1029 trace_span_start("filter_block_txs", b);
1030 filter_block_txs(topo, b);
1031 trace_span_end(b);
1032
1033 block_map_add(topo->block_map, b);
1034}
1035
1036static struct block *new_block(struct chain_topology *topo,
1037 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