mirror of
https://github.com/monero-project/monero.git
synced 2025-07-26 14:45:21 -04:00
Revert "Merge pull request #749"
This reverts commit7fa63a82a1
, reversing changes made tocb6be986c3
.
This commit is contained in:
parent
40b8a5f327
commit
01e0a69c17
15 changed files with 594 additions and 2909 deletions
|
@ -116,8 +116,8 @@ namespace cryptonote {
|
|||
return !carry;
|
||||
}
|
||||
|
||||
difficulty_type next_difficulty(std::vector<std::uint64_t> timestamps, std::vector<difficulty_type> cumulative_difficulties, size_t target_seconds) {
|
||||
|
||||
difficulty_type next_difficulty(vector<uint64_t> timestamps, vector<difficulty_type> cumulative_difficulties, size_t target_seconds) {
|
||||
//cutoff DIFFICULTY_LAG
|
||||
if(timestamps.size() > DIFFICULTY_WINDOW)
|
||||
{
|
||||
timestamps.resize(DIFFICULTY_WINDOW);
|
||||
|
@ -151,8 +151,6 @@ namespace cryptonote {
|
|||
assert(total_work > 0);
|
||||
uint64_t low, high;
|
||||
mul(total_work, target_seconds, low, high);
|
||||
// blockchain errors "difficulty overhead" if this function returns zero.
|
||||
// TODO: consider throwing an exception instead
|
||||
if (high != 0 || low + time_span - 1 < low) {
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue