more convenient name

This commit is contained in:
Ryan X. Charles 2014-09-17 15:17:54 -07:00
parent 9473bdf9b0
commit eb34a16511
1 changed files with 10 additions and 10 deletions

View File

@ -44,8 +44,8 @@ BIP32.prototype.fromRandom = function(networkstr) {
this.keypair = (new Keypair()).fromRandom();
this.hasPrivateKey = true;
this.pubKeyHash = Hash.sha256ripemd160(this.keypair.pubkey.toBuffer());
this.buildExtendedPublicKey();
this.buildExtendedPrivateKey();
this.buildxpubkey();
this.buildxprivkey();
};
BIP32.prototype.fromString = function(str) {
@ -77,8 +77,8 @@ BIP32.prototype.fromSeed = function(bytes, networkstr) {
this.hasPrivateKey = true;
this.pubKeyHash = Hash.sha256ripemd160(this.keypair.pubkey.toBuffer());
this.buildExtendedPublicKey();
this.buildExtendedPrivateKey();
this.buildxpubkey();
this.buildxprivkey();
return this;
};
@ -119,11 +119,11 @@ BIP32.prototype.initFromBytes = function(bytes) {
throw new Error('Invalid key');
}
this.buildExtendedPublicKey();
this.buildExtendedPrivateKey();
this.buildxpubkey();
this.buildxprivkey();
}
BIP32.prototype.buildExtendedPublicKey = function() {
BIP32.prototype.buildxpubkey = function() {
this.xpubkey = new Buffer([]);
var v = null;
@ -167,7 +167,7 @@ BIP32.prototype.xpubkeyString = function(format) {
}
}
BIP32.prototype.buildExtendedPrivateKey = function() {
BIP32.prototype.buildxprivkey = function() {
if (!this.hasPrivateKey) return;
this.xprivkey = new Buffer([]);
@ -306,8 +306,8 @@ BIP32.prototype.deriveChild = function(i) {
ret.pubKeyHash = Hash.sha256ripemd160(ret.keypair.pubkey.toBuffer());
ret.buildExtendedPublicKey();
ret.buildExtendedPrivateKey();
ret.buildxpubkey();
ret.buildxprivkey();
return ret;
}