HomePhabricator

Do merkle root and txid duplicates check simultaneously
584a358997e5Unpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

Do merkle root and txid duplicates check simultaneously

Move the txid duplicates check into BuildMerkleTree, where it can be done
much more efficiently (without needing to build a full txid set to detect
duplicates).

The previous version (using the std::set<uint256> to detect duplicates) was
also slightly too weak. A block mined with actual duplicate transactions
(which is invalid, due to the inputs of the duplicated transactions being
seen as double spends) would trigger the duplicates logic, resulting in the
block not being stored on disk, and rerequested. This change fixes that by
only triggering in the case of duplicated transactions that can actually
result in an identical merkle root.

Details

Provenance
Pieter Wuille <pieter.wuille@gmail.com>Authored on Sep 15 2014, 22:30
deadalnixPushed on May 14 2017, 22:04
Parents
rABC7a04f3d708fa: Merge pull request #4955
Branches
Unknown
Tags
Unknown

Event Timeline

Pieter Wuille <pieter.wuille@gmail.com> committed rABC584a358997e5: Do merkle root and txid duplicates check simultaneously (authored by Pieter Wuille <pieter.wuille@gmail.com>).Sep 24 2014, 17:17