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)
| 328 | // header data is copied, changes to header and to the field values |
| 329 | // will not affect the block. |
| 330 | func 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. |