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

Function new_block

lightningd/chaintopology.c:1036–1058  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1034}
1035
1036static struct block *new_block(struct chain_topology *topo,
1037 struct bitcoin_block *blk,
1038 unsigned int height)
1039{
1040 struct block *b = tal(topo, struct block);
1041
1042 bitcoin_block_blkid(blk, &b->blkid);
1043 log_debug(topo->log, "Adding block %u: %s",
1044 height,
1045 fmt_bitcoin_blkid(tmpctx, &b->blkid));
1046 assert(!block_map_get(topo->block_map, &b->blkid));
1047 b->next = NULL;
1048 b->prev = NULL;
1049
1050 b->height = height;
1051
1052 b->hdr = blk->hdr;
1053
1054 b->full_txs = tal_steal(b, blk->tx);
1055 b->txids = tal_steal(b, blk->txids);
1056
1057 return b;
1058}
1059
1060static void remove_tip(struct chain_topology *topo)
1061{

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