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

Function new_block

lightningd/chaintopology.c:1021–1043  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1019}
1020
1021static struct block *new_block(struct chain_topology *topo,
1022 struct bitcoin_block *blk,
1023 unsigned int height)
1024{
1025 struct block *b = tal(topo, struct block);
1026
1027 bitcoin_block_blkid(blk, &b->blkid);
1028 log_debug(topo->log, "Adding block %u: %s",
1029 height,
1030 fmt_bitcoin_blkid(tmpctx, &b->blkid));
1031 assert(!block_map_get(topo->block_map, &b->blkid));
1032 b->next = NULL;
1033 b->prev = NULL;
1034
1035 b->height = height;
1036
1037 b->hdr = blk->hdr;
1038
1039 b->full_txs = tal_steal(b, blk->tx);
1040 b->txids = tal_steal(b, blk->txids);
1041
1042 return b;
1043}
1044
1045static void remove_tip(struct chain_topology *topo)
1046{

Callers 2

get_new_blockFunction · 0.85
setup_topologyFunction · 0.85

Calls 2

bitcoin_block_blkidFunction · 0.85
fmt_bitcoin_blkidFunction · 0.85

Tested by

no test coverage detected