I'm connecting to a custom scrypt-based network and blocks received from the vanilla C++ client are not being validated. I discovered that the reason is that byte order is reversed between what pycoind receives in the block header and what is stored in its blocks database.
So, the question is, I guess, what is the expected endianess? The genesis block hash saved into the block db at init by pycoind is apparently stored as little-endian. But the C++ nodes are supplying headers with big-endian hashes, so when pycoind goes to look for the hash (or prev_hash) it doesn't find it and add_header() in blocks.py rejects the block based on raise InvalidBlockException('previous block does not exist')
Solved:
OK, I just read the notes in the coin template file and saw the requirement that the endianness of the genesis block hash be reversed.
I'm connecting to a custom scrypt-based network and blocks received from the vanilla C++ client are not being validated. I discovered that the reason is that byte order is reversed between what pycoind receives in the block header and what is stored in its blocks database.
So, the question is, I guess, what is the expected endianess? The genesis block hash saved into the block db at init by pycoind is apparently stored as little-endian. But the C++ nodes are supplying headers with big-endian hashes, so when pycoind goes to look for the hash (or prev_hash) it doesn't find it and
add_header()
in blocks.py rejects the block based onraise InvalidBlockException('previous block does not exist')
Solved: OK, I just read the notes in the coin template file and saw the requirement that the endianness of the genesis block hash be reversed.