CBlockHeader.ToString()
[NovacoinLibrary.git] / Novacoin / CBlockHeader.cs
1 \feffusing System;
2 using System.Text;
3 using System.Collections.Generic;
4
5 namespace Novacoin
6 {
7         /// <summary>
8         /// Block header
9         /// </summary>
10         public class CBlockHeader
11         {
12                 /// <summary>
13                 /// Version of block schema.
14                 /// </summary>
15                 public uint nVersion = 6;
16
17                 /// <summary>
18                 /// Previous block hash.
19                 /// </summary>
20                 public Hash256 prevHash = new Hash256();
21
22                 /// <summary>
23                 /// Merkle root hash.
24                 /// </summary>
25                 public Hash256 merkleRoot = new Hash256();
26
27                 /// <summary>
28                 /// Block timestamp.
29                 /// </summary>
30                 public uint nTime = 0;
31
32                 /// <summary>
33                 /// Compressed difficulty representation.
34                 /// </summary>
35                 public uint nBits = 0;
36
37                 /// <summary>
38                 /// Nonce counter.
39                 /// </summary>
40                 public uint nNonce = 0;
41
42                 public CBlockHeader ()
43                 {
44                 }
45
46         public override string ToString()
47         {
48             StringBuilder sb = new StringBuilder();
49             sb.AppendFormat("CBlockHeader(nVersion={0}, prevHash={1}, merkleRoot={2}, nTime={3}, nBits={4}, nNonce={5})", nVersion, prevHash.ToString(), merkleRoot.ToString(), nTime, nBits, nNonce);
50             return sb.ToString();
51         }
52         }
53 }