| 1007 | } |
| 1008 | |
| 1009 | static 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 | |
| 1036 | static struct block *new_block(struct chain_topology *topo, |
| 1037 | struct bitcoin_block *blk, |
no test coverage detected