mirror of
https://git.wownero.com/wownero/wownero.git
synced 2025-01-09 20:48:53 +00:00
Merge pull request #17 from wowario/master
fix signed unsigned conversion
This commit is contained in:
commit
785942478b
@ -219,11 +219,11 @@ namespace cryptonote {
|
|||||||
uint64_t difficulty(0), next_difficulty(0);
|
uint64_t difficulty(0), next_difficulty(0);
|
||||||
|
|
||||||
// Loop through N most recent blocks. N is most recently solved block.
|
// Loop through N most recent blocks. N is most recently solved block.
|
||||||
for (int64_t i = 1; i <= N; i++) {
|
for (size_t i = 1; i <= N; i++) {
|
||||||
solveTime = static_cast<int64_t>(timestamps[i]) - static_cast<int64_t>(timestamps[i - 1]);
|
solveTime = static_cast<int64_t>(timestamps[i]) - static_cast<int64_t>(timestamps[i - 1]);
|
||||||
solveTime = std::min<int64_t>((T * 7), std::max<int64_t>(solveTime, (-7 * T)));
|
solveTime = std::min<int64_t>((T * 7), std::max<int64_t>(solveTime, (-7 * T)));
|
||||||
difficulty = cumulative_difficulties[i] - cumulative_difficulties[i - 1];
|
difficulty = cumulative_difficulties[i] - cumulative_difficulties[i - 1];
|
||||||
LWMA += solveTime * i / k;
|
LWMA += (int64_t)(solveTime * i) / k;
|
||||||
sum_inverse_D += 1 / static_cast<double>(difficulty);
|
sum_inverse_D += 1 / static_cast<double>(difficulty);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user