fixed, again, mnemonic and address generation.

pull/5/head
moneroexamples 7 years ago
parent 5d2f1f5e20
commit 30b3756156

@ -437,37 +437,29 @@ var cnUtil = (function(initConfig) {
return bintohex(output);
};*/
this.create_address_old = function(seed) {
this.create_address = function(seed) {
var keys = {};
var first;
if (seed.length !== 64) {
first = this.cn_fast_hash(seed);
} else {
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);
keys.view = this.generate_keys(second);
keys.public_addr = this.pubkeys_to_string(keys.spend.pub, keys.view.pub);
return keys;
};
this.create_address = function(seed) {
var keys = {};
var first;
keys.spend = this.generate_keys(first);
if (seed.length !== 64) {
first = this.cn_fast_hash(seed);
var second = this.cn_fast_hash(first);
} else {
first = seed; //only input reduced seeds or this will not give you the result you want
var second = this.cn_fast_hash(keys.spend.sec);
}
keys.spend = this.generate_keys(first);
var second = this.cn_fast_hash(first);
keys.view = this.generate_keys(second);
keys.public_addr = this.pubkeys_to_string(keys.spend.pub, keys.view.pub);
return keys;
};
this.create_addr_prefix = function(seed) {
var first;
if (seed.length !== 64) {

@ -1,6 +1,6 @@
var config = {
apiUrl: "http://127.0.0.1:1984/",
testnet: false,
testnet: true,
coinUnitPlaces: 12,
txMinConfirms: 10, // corresponds to CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE in Monero
txCoinbaseMinConfirms: 60, // corresponds to CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW in Monero

Loading…
Cancel
Save