mirror of
https://github.com/ethereum/consensus-specs.git
synced 2026-02-02 21:35:18 -05:00
Merge pull request #397 from ralexstokes/fix-merkle-bug
Fixes bug with Merkle proof branch selection
This commit is contained in:
@@ -1478,7 +1478,7 @@ For each `deposit` in `block.body.deposits`:
|
||||
def verify_merkle_branch(leaf: Hash32, branch: [Hash32], depth: int, index: int, root: Hash32) -> bool:
|
||||
value = leaf
|
||||
for i in range(depth):
|
||||
if index % 2:
|
||||
if index // (2**i) % 2:
|
||||
value = hash(branch[i] + value)
|
||||
else:
|
||||
value = hash(value + branch[i])
|
||||
|
||||
Reference in New Issue
Block a user