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.
In chainstate/stacks/index/proofs.rs, nearly all of the checks that occur in
is_proof_well_formed
also occur inverify_proof
. For example, both functions check thatproof[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.