diwakergupta / stacks-blockchain-tob-audit

GNU General Public License v3.0
0 stars 0 forks source link

Duplicate functionality across verify_proof and is_proof_well_formed #6

Open blperez01 opened 4 years ago

blperez01 commented 4 years ago

In chainstate/stacks/index/proofs.rs, nearly all of the checks that occur in is_proof_well_formed also occur in verify_proof. For example, both functions check that proof[0] is a leaf node. They also both verify that there are the same number of segment and shunt proofs (the latter does so implicitly). This doesn't pose a security risk, but is redundant and makes code maintenance more difficult.