Example #1
0
 /// <summary>
 /// 构造一个新的区块
 /// </summary>
 /// <param name="lastBlock"></param>
 /// <param name="data"></param>
 public MBlock(MBlock lastBlock, object data)
 {
     Index     = lastBlock.Index + 1;
     TimeStamp = DateTimeManager.GetTimeStamp();
     Data      = data.ToJson();
     PrevHash  = lastBlock.Hash;
     Hash      = GetHash();
 }
Example #2
0
 /// <summary>
 /// 构造一个创世区块
 /// </summary>
 /// <param name="data"></param>
 public MBlock(object data)
 {
     Index     = 0;
     TimeStamp = DateTimeManager.GetTimeStamp();
     Data      = data.ToJson();
     PrevHash  = string.Empty;
     Hash      = GetHash();
 }