示例#1
0
 private ConsensusPayload MakePayload(ConsensusMessage message)
 {
     message.ViewNumber = ViewNumber;
     return(new ConsensusPayload
     {
         Version = Version,
         PrevHash = PrevHash,
         ChainHash = ChainHash,
         BlockIndex = BlockIndex,
         ValidatorIndex = (ushort)MyIndex,
         Timestamp = Timestamp,
         Data = message.ToArray()
     });
 }
示例#2
0
        private ConsensusPayload MakeSignedPayload(ConsensusMessage message)
        {
            message.ViewNumber = ViewNumber;
            ConsensusPayload payload = new ConsensusPayload
            {
                Version        = Version,
                PrevHash       = PrevHash,
                ChainHash      = blockchain.ChainHash,
                BlockIndex     = BlockIndex,
                ValidatorIndex = (ushort)MyIndex,
                Timestamp      = Timestamp,
                Data           = message.ToArray()
            };

            SignPayload(payload);
            return(payload);
        }