copyWith method
Creates a copy of this block header with optional field overrides.
Implementation
BlockHeader copyWith({
int? version,
Hash? prevBlock,
Hash? merkleRoot,
DateTime? timestamp,
int? bits,
int? nonce,
}) {
return BlockHeader(
version: version ?? this.version,
prevBlock: prevBlock ?? this.prevBlock,
merkleRoot: merkleRoot ?? this.merkleRoot,
timestamp: timestamp ?? this.timestamp,
bits: bits ?? this.bits,
nonce: nonce ?? this.nonce,
);
}