Merge pull request #377 from terenc3t/patch-26

concatenation for hash function
This commit is contained in:
vbuterin 2018-12-30 21:15:40 -06:00 committed by GitHub
commit 102f6f480e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -1529,9 +1529,9 @@ def verify_merkle_branch(leaf: Hash32, branch: [Hash32], depth: int, index: int,
value = leaf value = leaf
for i in range(depth): for i in range(depth):
if index % 2: if index % 2:
value = hash(branch[i], value) value = hash(branch[i] + value)
else: else:
value = hash(value, branch[i]) value = hash(value + branch[i])
return value == root return value == root
``` ```