hd/wallet: minor.
This commit is contained in:
parent
b900d706c0
commit
c0d0423f14
@ -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,
|
||||
|
||||
@ -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({
|
||||
|
||||
Loading…
Reference in New Issue
Block a user