Skip to content

FormatHashBlocks: blocks = 1 + ((len + 8) / 64); // should be len + 9 #599

@dmgores

Description

@dmgores

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions