From 890a90f9b4b567d17e150799a9b49fb3ace38817 Mon Sep 17 00:00:00 2001
From: cgeek <cem.moreau@gmail.com>
Date: Thu, 16 Mar 2017 18:19:24 +0100
Subject: [PATCH] [fix] #893 Allow any 1-64 chars password for XHX unlocking

---
 app/lib/constants.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/app/lib/constants.js b/app/lib/constants.js
index bf62f8fee..9af6ffbfa 100644
--- a/app/lib/constants.js
+++ b/app/lib/constants.js
@@ -10,6 +10,7 @@ const POSITIVE_INT = "[1-9][0-9]{0,18}";
 const DIVIDEND     = "[1-9][0-9]{0,5}";
 const ZERO_OR_POSITIVE_INT = "0|[1-9][0-9]{0,18}";
 const INTEGER      = "(0|[1-9]\\d{0,18})";
+const XUNLOCK      = "[a-zA-Z0-9]{1,64}";
 const RELATIVE_INTEGER = "(0|-?[1-9]\\d{0,18})";
 const FLOAT        = "\\d+\.\\d+";
 const BOOLEAN      = "[01]";
@@ -18,9 +19,9 @@ const TX_VERSION   = "(10)";
 const SIGNATURE    = "[A-Za-z0-9+\\/=]{87,88}";
 const FINGERPRINT  = "[A-F0-9]{64}";
 const COMMENT      = "[ a-zA-Z0-9-_:/;*\\[\\]()?!^\\+=@&~#{}|\\\\<>%.]{0,255}";
-const UNLOCK       = "(SIG\\(" + INTEGER + "\\)|XHX\\(" + INTEGER + "\\))";
 const CONDITIONS   = "(&&|\\|\\|| |[()]|(SIG\\([0-9a-zA-Z]{43,44}\\)|(XHX\\([A-F0-9]{64}\\))))*";
 //const CONDITIONS   = "(&&|\|\|| |[()]|(SIG\\(\\da-zA-Z\\))|(XHX\\(" + FINGERPRINT + "\\)))*";
+const UNLOCK       = "(SIG\\(" + INTEGER + "\\)|XHX\\(" + XUNLOCK + "\\))";
 const BLOCK_UID    = INTEGER + "-" + FINGERPRINT;
 const META_TS      = "META:TS:" + BLOCK_UID;
 
-- 
GitLab