Fix merkle multiProof for single leaf tree (#3446)
This commit is contained in:
@ -105,7 +105,13 @@ library MerkleProof {
|
||||
hashes[i] = _hashPair(a, b);
|
||||
}
|
||||
|
||||
return hashes[totalHashes - 1];
|
||||
if (totalHashes > 0) {
|
||||
return hashes[totalHashes - 1];
|
||||
} else if (leafsLen > 0) {
|
||||
return leafs[0];
|
||||
} else {
|
||||
return proofs[0];
|
||||
}
|
||||
}
|
||||
|
||||
function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) {
|
||||
|
||||
Reference in New Issue
Block a user