removed validator's cycle var

Former-commit-id: 2d019e818145aaf8510d38da46b3a0748d68cb93 [formerly db9083c59f38349e7dcba65ec4fb2843b709818a]
Former-commit-id: 8ef26b218aec854a987697e3c73e104f85cb3c65
This commit is contained in:
Fynn 2018-02-05 14:10:28 +01:00
parent dd4a391f8b
commit 50ce4c735c

View File

@ -11,8 +11,6 @@ contract VMC {
uint deposit;
// The validator's address
address addr;
// The cycle number which the validator would be included after
int cycle;
}
struct CollationHeader {
@ -81,7 +79,7 @@ contract VMC {
for (int i = 0; i < 1024; ++i) {
if (i >= allValidatorSlotsNum)
break;
if (validators[i].cycle != 0x0)
if (validators[i].addr != 0x0)
activateValidatorNum += 1;
}
return activateValidatorNum + emptySlotsStackTop;
@ -123,7 +121,7 @@ contract VMC {
// Uses a block hash as a seed to pseudorandomly select a signer from the validator set.
// [TODO] Chance of being selected should be proportional to the validator's deposit.
// Should be able to return a value for the current period or any future period up to.
function getEligibleProposer(int shardId, int period) public {
function getEligibleProposer(int shardId, uint period) public {
require(period >= lookAheadPeriods);
require((period - lookAheadPeriods) * periodLength < block.number);
require(numValidators > 0);