Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed bug: For extension node condition should use current path pointer #651

Merged
merged 5 commits into from
Feb 20, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion contracts/lib/MerklePatriciaProof.sol
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ library MerklePatriciaProof {
nodeKey = RLP.toBytes32(currentNodeList[nextPathNibble]);
pathPtr += 1;
} else if(currentNodeList.length == 2) {
uint currentpathPtr = pathPtr;
0xsarvesh marked this conversation as resolved.
Show resolved Hide resolved
0xsarvesh marked this conversation as resolved.
Show resolved Hide resolved
pathPtr += _nibblesToTraverse(RLP.toData(currentNodeList[0]), path, pathPtr);
0xsarvesh marked this conversation as resolved.
Show resolved Hide resolved

if(pathPtr == path.length) {//leaf node
Expand All @@ -70,7 +71,7 @@ library MerklePatriciaProof {
}
}
//extension node ... test if means that it is empty value
0xsarvesh marked this conversation as resolved.
Show resolved Hide resolved
if(_nibblesToTraverse(RLP.toData(currentNodeList[0]), path, pathPtr) == 0) {
if(_nibblesToTraverse(RLP.toData(currentNodeList[0]), path, currentpathPtr) == 0) {
return (keccak256(abi.encodePacked()) == value);
0xsarvesh marked this conversation as resolved.
Show resolved Hide resolved
0xsarvesh marked this conversation as resolved.
Show resolved Hide resolved
}

Expand Down