dtr-org / unit-e

A digital currency for a new era of decentralized trust
https://unit-e.io
MIT License
45 stars 15 forks source link

Check difficulty in ContextualCheckBlockHeader #957

Open scravy opened 5 years ago

scravy commented 5 years ago

LegacyValidationInterface::ContextualCheckBlockHeader does not check difficulty.

939 might fix that, or a smaller patch can just patch this in.

@Ruteri inintially reported, I'm aware of it, but lets not forget about it.

scravy commented 5 years ago

Actually, whether the difficulty is met is correctly checked in CheckStake, as difficulty affects eligibility of a coin. This check does not rely on nBits in the header. In fact, this value is never read. That is to say, we could actually drop it form the header.