Closed danielcrane closed 7 years ago
On line 17 of blockhash.py the calculation of the median has an error in the indexing of elements.
return (data[length // 2] + data[length // 2 + 1]) / 2.0
should instead be:
return (data[length // 2 - 1] + data[length // 2]) / 2.0
due to the zero-based indexing of Python.
Good catch, this should be corrected along with the tests.
On line 17 of blockhash.py the calculation of the median has an error in the indexing of elements.
return (data[length // 2] + data[length // 2 + 1]) / 2.0
should instead be:
return (data[length // 2 - 1] + data[length // 2]) / 2.0
due to the zero-based indexing of Python.