wallet: use private key for token hash.
This commit is contained in:
parent
487efb6639
commit
6e770279db
@ -435,7 +435,7 @@ Wallet.prototype.getID = function getID() {
|
||||
|
||||
/**
|
||||
* Generate the wallet api key if none was passed in.
|
||||
* It is represented as HASH256(m/44'->public|nonce).
|
||||
* It is represented as HASH256(m/44'->private|nonce).
|
||||
* @private
|
||||
* @param {HDPrivateKey} master
|
||||
* @param {Number} nonce
|
||||
@ -450,7 +450,7 @@ Wallet.prototype.getToken = function getToken(master, nonce) {
|
||||
key = master.derive(44, true);
|
||||
|
||||
p = new BufferWriter();
|
||||
p.writeBytes(key.publicKey);
|
||||
p.writeBytes(key.privateKey);
|
||||
p.writeU32(nonce);
|
||||
|
||||
return utils.hash256(p.render());
|
||||
|
||||
Loading…
Reference in New Issue
Block a user