This makes the comparison consistent with arith_uint256 .
Details
Details
- Reviewers
schancel jasonbcox - Group Reviewers
Restricted Project - Commits
- rSTAGING7a5e1e55ec95: Modify uint256's comparison to use proper endianess
rABC7a5e1e55ec95: Modify uint256's comparison to use proper endianess
Updated unit tests.
Diff Detail
Diff Detail
- Repository
- rABC Bitcoin ABC
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
src/uint256.h | ||
---|---|---|
44 ↗ | (On Diff #4174) | These are big endian and this is to ensure they're compared from smallest to largest byte? |
src/test/uint256_tests.cpp | ||
---|---|---|
129 ↗ | (On Diff #4174) | What's the purpose of these bitshifts? |
src/uint256.h | ||
---|---|---|
43 ↗ | (On Diff #4174) | Can't this Compare() function take any size of base_blob? If so, this line will segfault if other is smaller than this. Maybe the first check should be if (sizeof(data) == sizeof(other.data)) { |
src/uint256.h | ||
---|---|---|
43 ↗ | (On Diff #4174) | base_blob is a template. it cannot be any size. |
src/uint256.h | ||
---|---|---|
44 ↗ | (On Diff #4174) | Oh right, the MSB should be compared first. Sorry. |