hd/wallet: minor.

This commit is contained in:
Christopher Jeffrey 2015-12-20 12:58:57 -08:00
parent b900d706c0
commit c0d0423f14
2 changed files with 4 additions and 4 deletions

View File

@ -522,7 +522,7 @@ HDPublicKey.prototype._build = function _build(data) {
};
HDPublicKey.prototype.derive = function derive(index, hardened) {
var data, hash, leftPart, chainCode, pair, pubkeyPoint, publicKey;
var data, hash, leftPart, chainCode, pair, point, publicKey;
if (typeof index === 'string')
return this.deriveString(index);
@ -539,8 +539,8 @@ HDPublicKey.prototype.derive = function derive(index, hardened) {
chainCode = hash.slice(32, 64);
pair = bcoin.ecdsa.keyPair({ pub: this.publicKey });
pubkeyPoint = ec.curve.g.mul(leftPart).add(pair.pub);
publicKey = bcoin.ecdsa.keyFromPublic(pubkeyPoint).getPublic(true, 'array');
point = ec.curve.g.mul(leftPart).add(pair.pub);
publicKey = bcoin.ecdsa.keyPair({ pub: point }).getPublic(true, 'array');
return new HDPublicKey({
version: null,

View File

@ -654,7 +654,7 @@ Wallet.fromJSON = function fromJSON(json, decrypt) {
json.hd.seed.mnemonic = decrypt(json.hd.seed.mnemonic);
json.hd.seed.passphrase = decrypt(json.hd.seed.passphrase);
}
priv = new hd.priv(json.hd);
priv = bcoin.hd.priv(json.hd);
}
w = new Wallet({