Added var to properly declare local variables so that they don't pollute the global namespace and risk multi-threading conflicts.
diff --git a/js/securityLib/rsasign-1.2.js b/js/securityLib/rsasign-1.2.js
index 1f02f80..0da2827 100644
--- a/js/securityLib/rsasign-1.2.js
+++ b/js/securityLib/rsasign-1.2.js
@@ -313,9 +313,9 @@
msgHashValue = ff(byteArray);
} else {
// Compute merkle hash
- h = hex_sha256_from_bytes(byteArray);
- index = witness.path.index;
- for (i = witness.path.digestList.length - 1; i >= 0; i--) {
+ var h = hex_sha256_from_bytes(byteArray);
+ var index = witness.path.index;
+ for (var i = witness.path.digestList.length - 1; i >= 0; i--) {
var str = "";
if (index % 2 == 0) {
str = h + witness.path.digestList[i];