Merge pull request #75 from NIC619/fix_bin_trie_update_kv_node

fix leaf node encoding in updating kv node
This commit is contained in:
NIC Lin 2017-12-23 00:29:22 +09:00 committed by GitHub
commit b71c397a41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -134,7 +134,7 @@ def _update(db, node, keypath, val):
# valnode: the child node that has the new value we are adding
# Case 1: keypath prefixes almost match, so we are in case (i), (ii), (v), (vi)
if len(keypath) == cf + 1:
valnode = val
valnode = hash_and_save(db, encode_leaf_node(val))
# Case 2: keypath prefixes mismatch in the middle, so we need to break
# the keypath in half. We are in case (iii), (iv), (vii), (viii)
else: