From 6e770279dbf38376e1918615fa2dd9fc75af8d6f Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Sat, 13 Aug 2016 18:40:45 -0700 Subject: [PATCH] wallet: use private key for token hash. --- lib/bcoin/wallet.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/bcoin/wallet.js b/lib/bcoin/wallet.js index 23b3d16c..7a4fb998 100644 --- a/lib/bcoin/wallet.js +++ b/lib/bcoin/wallet.js @@ -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());