From 8630bbbef48bbcde2b8bf76305dd2e5116d2499c Mon Sep 17 00:00:00 2001 From: moneroexamples Date: Sun, 24 Feb 2019 12:18:05 +0800 Subject: [PATCH] correct create_address in js --- html/js/cn_util.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/html/js/cn_util.js b/html/js/cn_util.js index b164534..eb41587 100644 --- a/html/js/cn_util.js +++ b/html/js/cn_util.js @@ -442,7 +442,14 @@ var cnUtil = (function(initConfig) { first = seed; //only input reduced seeds or this will not give you the result you want } keys.spend = this.generate_keys(first); - var second = this.cn_fast_hash(first); + + var second; + if (seed.length !== 64) { + second = this.cn_fast_hash(first); + } else { + second = this.cn_fast_hash(keys.spend.sec); + } + keys.view = this.generate_keys(second); keys.public_addr = this.pubkeys_to_string(keys.spend.pub, keys.view.pub); return keys;