diff --git a/js/models/PublicKeyRing.js b/js/models/PublicKeyRing.js index 42e6fa626..dba051db9 100644 --- a/js/models/PublicKeyRing.js +++ b/js/models/PublicKeyRing.js @@ -14,17 +14,6 @@ var buffertools = bitcore.buffertools; var Storage = imports.Storage || require('./Storage'); var storage = Storage.default(); -/* - * This follow Electrum convetion, as described in - * https://bitcointalk.org/index.php?topic=274182.0 - * - * We should probably adopt the next standard once it's ready, as discussed in: - * http://sourceforge.net/p/bitcoin/mailman/message/32148600/ - * - */ - -var PUBLIC_BRANCH = 'm/0/'; -var CHANGE_BRANCH = 'm/1/'; function PublicKeyRing(opts) { opts = opts || {}; @@ -44,6 +33,22 @@ function PublicKeyRing(opts) { this.addressIndex=0; } +/* + * This follow Electrum convetion, as described in + * https://bitcointalk.org/index.php?topic=274182.0 + * + * We should probably adopt the next standard once it's ready, as discussed in: + * http://sourceforge.net/p/bitcoin/mailman/message/32148600/ + * + */ + +PublicKeyRing.PublicBranch = function (index) { + return 'm/0/'+index; +}; + +PublicKeyRing.ChangeBranch = function (index) { + return 'm/1/'+index; +}; PublicKeyRing.getRandomId = function () { return buffertools.toHex(coinUtil.generateNonce()); @@ -177,7 +182,7 @@ PublicKeyRing.prototype.getPubKeys = function (index, isChange) { var pubKeys = []; var l = this.copayersBIP32.length; for(var i=0; i