diff options
author | Fabian Jahr <fjahr@protonmail.com> | 2023-10-18 17:06:36 +0200 |
---|---|---|
committer | Fabian Jahr <fjahr@protonmail.com> | 2023-10-20 22:53:05 +0200 |
commit | 351370a1d211615e3d5b158ccb0400cd79c5c085 (patch) | |
tree | 8c9aae8e3d92a1d3aaf1cd344838d4101f1a8913 /src/test | |
parent | c1106cfef514115e91c2185a58840d7fb0e34c89 (diff) |
coinstats: Fix hash_serialized2 calculation
The legacy serialization was vulnerable to maleation and is fixed by
adopting the same serialization procedure as was already in use for
MuHash.
This also includes necessary test fixes where the hash_serialized2 was
hardcoded as well as correction of the regtest chainparams.
Co-authored-by: Sebastian Falbesoner <sebastian.falbesoner@gmail.com>
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/validation_tests.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/validation_tests.cpp b/src/test/validation_tests.cpp index 2692037273..14440571eb 100644 --- a/src/test/validation_tests.cpp +++ b/src/test/validation_tests.cpp @@ -137,11 +137,11 @@ BOOST_AUTO_TEST_CASE(test_assumeutxo) } const auto out110 = *params->AssumeutxoForHeight(110); - BOOST_CHECK_EQUAL(out110.hash_serialized.ToString(), "1ebbf5850204c0bdb15bf030f47c7fe91d45c44c712697e4509ba67adb01c618"); + BOOST_CHECK_EQUAL(out110.hash_serialized.ToString(), "6657b736d4fe4db0cbc796789e812d5dba7f5c143764b1b6905612f1830609d1"); BOOST_CHECK_EQUAL(out110.nChainTx, 111U); const auto out110_2 = *params->AssumeutxoForBlockhash(uint256S("0x696e92821f65549c7ee134edceeeeaaa4105647a3c4fd9f298c0aec0ab50425c")); - BOOST_CHECK_EQUAL(out110_2.hash_serialized.ToString(), "1ebbf5850204c0bdb15bf030f47c7fe91d45c44c712697e4509ba67adb01c618"); + BOOST_CHECK_EQUAL(out110_2.hash_serialized.ToString(), "6657b736d4fe4db0cbc796789e812d5dba7f5c143764b1b6905612f1830609d1"); BOOST_CHECK_EQUAL(out110_2.nChainTx, 111U); } |