| 712 | } |
| 713 | |
| 714 | static void add_tip(struct chain_topology *topo, struct block *b) |
| 715 | { |
| 716 | /* Attach to tip; b is now the tip. */ |
| 717 | assert(b->height == topo->tip->height + 1); |
| 718 | b->prev = topo->tip; |
| 719 | topo->tip->next = b; /* FIXME this doesn't seem to be used anywhere */ |
| 720 | topo->tip = b; |
| 721 | wallet_block_add(topo->ld->wallet, b); |
| 722 | |
| 723 | topo_add_utxos(topo, b); |
| 724 | topo_update_spends(topo, b); |
| 725 | |
| 726 | /* Only keep the transactions we care about. */ |
| 727 | filter_block_txs(topo, b); |
| 728 | |
| 729 | block_map_add(&topo->block_map, b); |
| 730 | topo->max_blockheight = b->height; |
| 731 | } |
| 732 | |
| 733 | static struct block *new_block(struct chain_topology *topo, |
| 734 | struct bitcoin_block *blk, |
no test coverage detected