MCPcopy Create free account
hub / github.com/CPChain/chain / NewBlockWithHeader

Function NewBlockWithHeader

types/block.go:330–332  ·  view source on GitHub ↗

NewBlockWithHeader creates a block with the given header data. The header data is copied, changes to header and to the field values will not affect the block.

(header *Header)

Source from the content-addressed store, hash-verified

328// header data is copied, changes to header and to the field values
329// will not affect the block.
330func NewBlockWithHeader(header *Header) *Block {
331 return &Block{header: CopyHeader(header)}
332}
333
334// CopyHeader creates a deep copy of a block header to prevent side effects from
335// modifying a header variable.

Callers 1

Calls 1

CopyHeaderFunction · 0.85

Tested by 1