Files
bitcoin/src
Lőrinc ef501a63d9 consensus: document merkle mutation root invariant
Document the `mutated` output flag on the `ComputeMerkleRoot` declaration and explain in the inner loop why the mutation check runs at every tree level even after a duplicate is found.
Add a direct regression test for the duplicate-subtree construction described in the code comments for CVE-2012-2459: `[1,2,3,4,5,6]` and `[1,2,3,4,5,6,5,6]` produce the same root.
The test also verifies that mutation detection checks equal pairs before the final pair of a tree level.

The existing `merkle_test` already exercises this behavior indirectly through random duplications and old-vs-new comparisons.
The new test pins it down explicitly through the `ComputeMerkleRoot` API.
Both would fail under a refactor that stops the outer reduction once mutation is detected.

Co-authored-by: Hodlinator <172445034+hodlinator@users.noreply.github.com>
2026-08-13 11:21:12 -07:00
..
2026-08-03 12:03:56 -07:00
2026-07-22 12:38:13 -07:00
2026-07-23 12:06:32 +02:00
2026-07-23 12:06:32 +02:00
2026-08-03 12:03:56 -07:00
2026-08-10 16:02:20 +03:00
2026-08-05 21:41:49 +02:00