mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-07 23:03:04 +00:00
AbstractBlockChain: Fix median timestamp calculation.
Resolves issue 370.
This commit is contained in:
parent
3d6691c82a
commit
a78b53c5aa
@ -495,7 +495,7 @@ public abstract class AbstractBlockChain {
|
|||||||
while (unused >= 0 && (storedBlock = storedBlock.getPrev(store)) != null)
|
while (unused >= 0 && (storedBlock = storedBlock.getPrev(store)) != null)
|
||||||
timestamps[unused--] = storedBlock.getHeader().getTimeSeconds();
|
timestamps[unused--] = storedBlock.getHeader().getTimeSeconds();
|
||||||
|
|
||||||
Arrays.sort(timestamps, unused+1, 10);
|
Arrays.sort(timestamps, unused+1, 11);
|
||||||
return timestamps[unused + (11-unused)/2];
|
return timestamps[unused + (11-unused)/2];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user