wallet: use private key for token hash.

This commit is contained in:
Christopher Jeffrey 2016-08-13 18:40:45 -07:00
parent 487efb6639
commit 6e770279db
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -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());