| 992 | } |
| 993 | |
| 994 | static 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 | |
| 1021 | static struct block *new_block(struct chain_topology *topo, |
| 1022 | struct bitcoin_block *blk, |
no test coverage detected