Alternative approach: #13258.
There is no reason for uint256::GetCheapHash()
to support multi-platform endian-ness, since the cheap hash is never used outside of the internal system (it is used in CAddrInfo
bucket stuff, and that’s it). We can remove an entire #include
and probably some overhead as well. This will remove a number of chained dependencies from uint256
(crypto/common.h
, compat/endian.h
, and compat/byteswap.h
).
Edit: due to the dependency on little endian in the tests for the address manager, #7078 switched to the ReadLE64()
function. This test reverts that decision and updates the tests instead to work with big and little endian. These tests need to be rethought, possibly removed, as they test basically nothing right now*, but in the meantime, this will address the test errors for big endian.
(* they test that after adding a, b, and c to a bucket, adding d will cause a collision, but adding e will not…)