| 731 | } |
| 732 | |
| 733 | static struct block *new_block(struct chain_topology *topo, |
| 734 | struct bitcoin_block *blk, |
| 735 | unsigned int height) |
| 736 | { |
| 737 | struct block *b = tal(topo, struct block); |
| 738 | |
| 739 | bitcoin_block_blkid(blk, &b->blkid); |
| 740 | log_debug(topo->log, "Adding block %u: %s", |
| 741 | height, |
| 742 | type_to_string(tmpctx, struct bitcoin_blkid, &b->blkid)); |
| 743 | assert(!block_map_get(&topo->block_map, &b->blkid)); |
| 744 | b->next = NULL; |
| 745 | b->prev = NULL; |
| 746 | |
| 747 | b->height = height; |
| 748 | |
| 749 | b->hdr = blk->hdr; |
| 750 | |
| 751 | b->full_txs = tal_steal(b, blk->tx); |
| 752 | b->txids = tal_steal(b, blk->txids); |
| 753 | |
| 754 | return b; |
| 755 | } |
| 756 | |
| 757 | static void remove_tip(struct chain_topology *topo) |
| 758 | { |
no test coverage detected