jjyr/mmr.py

跳跃错误

Closed this issue · 3 comments

父节点和左子节点 offset 为 2 ** height
兄弟节点间的 offset 为 2 ** (height + 1) - 1

代码运算 2^height应该是

1  <<  height

而不是

2 << height

by the way, I've found another manipulation for mmr. I'll share with you later.

jjyr commented

348c0c6

2 ** (height + 1) - 1 -> (2 << height) - 1

Thanks for your explanation. I got another problem and opened a new issue for help.