Ejemplo n.º 1
0
        public VoteProcess(IVoteProcessHandler <BlockType> voteHandler, VoteMembers voteMembers, BlockType lastBlock, short issuer, Key issuerKey, int revision)
        {
            _voteHandler = voteHandler;

            LastBlock = lastBlock;
            if (LastBlock != null)
            {
                NextBlockId = LastBlock.BlockId + 1;
            }
            else
            {
                NextBlockId = Protocol.GenesisBlockId;
            }

            LocalIssuer    = issuer;
            LocalIssuerKey = issuerKey;

            _members       = voteMembers;
            _localRevision = revision;

            foreach (var key in _members.VoteKeys.Values)
            {
                _voteKeyProposals.Add(key.KeyIndex, new SortedList <int, VoteProposal>());
            }
        }
Ejemplo n.º 2
0
        public VoteProposal(VoteMembers members, long blockId, int revision, Block blockData, short issuerKeyIndex)
        {
            BlockId         = blockId;
            Revision        = revision;
            Block           = blockData;
            _issuerKeyIndex = issuerKeyIndex;

            _members = members;
            foreach (var key in _members.VoteKeys.Values)
            {
                _votes.Add(key.KeyIndex, null);
            }
        }