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

Function new_block

lightningd/chaintopology.c:733–755  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

731}
732
733static 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
757static void remove_tip(struct chain_topology *topo)
758{

Callers 2

get_new_blockFunction · 0.85
init_topoFunction · 0.85

Calls 2

bitcoin_block_blkidFunction · 0.85
type_to_stringClass · 0.50

Tested by

no test coverage detected