public uint nNonce { get; set; }
/// <summary>
+ /// Next block hash.
+ /// </summary>
+ public byte[] nextHash { get; set; }
+
+ /// <summary>
/// Block type flags
/// </summary>
public BlockType BlockTypeFlag { get; set; }
public byte nEntropyBit { get; set; }
/// <summary>
+ /// Proof-of-Stake hash
+ /// </summary>
+ public byte[] hashProofOfStake { get; set; }
+
+ /// <summary>
/// Block height
/// </summary>
public uint nHeight { get; set; }
}
/// <summary>
+ /// Next block cursor
+ /// </summary>
+ public CBlockStoreItem next
+ {
+ get { return CBlockStore.Instance.GetCursor(nextHash); }
+ }
+
+ /// <summary>
/// STake modifier generation flag
/// </summary>
public bool GeneratedStakeModifier
get { return (BlockTypeFlag & BlockType.BLOCK_STAKE_MODIFIER) != 0; }
}
+ public uint StakeEntropyBit
+ {
+ get { return ((uint)(BlockTypeFlag & BlockType.BLOCK_STAKE_ENTROPY) >> 1); }
+ }
+
/// <summary>
/// Sets stake modifier and flag.
/// </summary>
// TODO: compute stake modifier
// Add to index
- itemTemplate.BlockTypeFlag = block.IsProofOfStake ? BlockType.PROOF_OF_STAKE : BlockType.PROOF_OF_WORK;
+ if (block.IsProofOfStake)
+ {
+ itemTemplate.SetProofOfStake();
+ }
if (!itemTemplate.WriteToFile(ref writer, ref block))
{