EthereumCommonwealth / Cold-staking

BSD 4-Clause "Original" or "Old" License
21 stars 19 forks source link

StakingRewardPool value update #5

Closed RideSolo closed 6 years ago

RideSolo commented 6 years ago

StakingRewardPool is updated once inside newBlock() function:

StakingRewardPool = address(this).balance.sub(TotalStakingAmount + msg.value);

However stakers can call start_staking multiple times in the same block. which mean that StakingRewardPool will be updated only once because of the following condition:

if (block.number > LastBlock)
{
    ....
}

The previous used CurrentBlockDeposits might solve this issue.

RideSolo commented 6 years ago

TotalStakingAmount is updated inside start_staking. the issue is not relevent.