Please login or register.

How to validate a block received from daemon API

If I take a getBlock response from the daemon API, it contains a blob, and the header details, including a hash.

How do I go about validating this block manually (or using methods from the monero source code)? Is result.block_header.hash a cryptonight hash of result.blob? I've tried this in a unit test of the source code and it doesn't seem to work.

I've also tried running the result.blob hash through the embedded check_hash(hash,difficulty) method, using the difficulty provided in the header details, and I keep getting a false.

How can I take the data that comes from getBlock and validate it?

Replies: 0