Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions contracts/IncentiveLayer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ contract IncentiveLayer is JackpotManager, DepositsManager, RewardsManager {
bytes32 initTaskHash;
mapping(address => bytes32) challenges;
State state;
bytes32 blockhash;
bytes32 randomBitsHash;
uint taskCreationBlockNumber;
mapping(address => uint) bondedDeposits;
Expand Down Expand Up @@ -244,7 +243,6 @@ contract IncentiveLayer is JackpotManager, DepositsManager, RewardsManager {
bondDeposit(taskID, msg.sender, t.minDeposit);
t.selectedSolver = msg.sender;
t.randomBitsHash = randomBitsHash;
t.blockhash = blockhash(block.number.add(1));
t.state = State.SolverSelected;

// Burn task giver's taxes now that someone has claimed the task
Expand All @@ -271,7 +269,6 @@ contract IncentiveLayer is JackpotManager, DepositsManager, RewardsManager {
bondDeposit(taskID, msg.sender, t.minDeposit);
t.selectedSolver = msg.sender;
t.randomBitsHash = randomBitsHash;
t.blockhash = blockhash(block.number.add(1));
t.state = State.SolverSelected;

emit SolverSelected(taskID, msg.sender, t.initTaskHash, t.minDeposit, t.randomBitsHash);
Expand Down Expand Up @@ -396,7 +393,7 @@ contract IncentiveLayer is JackpotManager, DepositsManager, RewardsManager {
}

function isForcedError(uint randomBits) internal view returns (bool) {
return (uint(keccak256(abi.encodePacked(randomBits, blockhash(block.number)))) < forcedErrorThreshold);
return (uint(keccak256(abi.encodePacked(randomBits, blockhash(block.number-1)))) < forcedErrorThreshold);
}

function rewardJackpot(uint taskID) internal {
Expand Down