mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-01-27 02:45:28 +00:00
Merge pull request #397 from ralexstokes/fix-merkle-bug
Fixes bug with Merkle proof branch selection
This commit is contained in:
commit
14e14ce576
@ -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])
|
||||
|
Loading…
x
Reference in New Issue
Block a user