bitcoin/bitcoin — Issue #599: FormatHashBlocks: blocks = 1 + ((len + 8) / 64); // should be len + 9
Author: dmgores
Created: 2011-10-29 20:49:51+00:00
State: open

FormatHashBlocks:
int blocks = 1 + ((len + 8) / 64);

I think this should be len+9, because 64 bits are used for the bit count, and then assuming the input's length is in whole bytes, you will need one more byte in front of the length bytes to place the 0x80. Note this does not effect current versions of bitcoin, but maybe in the future if the length of the block's hash input changed, this could be a problem.

Cheers,
Dean