Fixed typo on getAddressesOrdered
This commit is contained in:
parent
27e0a8a560
commit
e415604870
5 changed files with 38 additions and 17 deletions
|
|
@ -540,13 +540,13 @@ PublicKeyRing.prototype.getAddresses = function() {
|
|||
};
|
||||
|
||||
/**
|
||||
* getAddressesOrderer
|
||||
* {@link Wallet#getAddressesOrderer}
|
||||
* getAddressesOrdered
|
||||
* {@link Wallet#getAddressesOrdered}
|
||||
*
|
||||
* @param pubkey
|
||||
* @return {string[]}
|
||||
*/
|
||||
PublicKeyRing.prototype.getAddressesOrderer = function(pubkey) {
|
||||
PublicKeyRing.prototype.getAddressesOrdered = function(pubkey) {
|
||||
this._checkCache();
|
||||
|
||||
var info = _.map(this.cache.addressToPath, function(path, addr) {
|
||||
|
|
@ -559,9 +559,7 @@ PublicKeyRing.prototype.getAddressesOrderer = function(pubkey) {
|
|||
var l = info.length;
|
||||
|
||||
var sortedInfo = _.sortBy(info, function(i) {
|
||||
var goodness = ( (i.copayerIndex !== copayerIndex) ? 2 * l : 0 )
|
||||
+ ( i.isChange ? l : 0 )
|
||||
+ l - i.addressIndex;
|
||||
var goodness = ((i.copayerIndex !== copayerIndex) ? 2 * l : 0) + (i.isChange ? l : 0) + l - i.addressIndex;
|
||||
return goodness;
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -2062,13 +2062,13 @@ Wallet.prototype.getAddresses = function() {
|
|||
|
||||
|
||||
/**
|
||||
* @desc gets the list of addresses, orderder for the caller:
|
||||
* @desc gets the list of addresses, ordered for the caller:
|
||||
* 1) himselfs first
|
||||
* 2) receive address first
|
||||
* 3) last created first
|
||||
*/
|
||||
Wallet.prototype.getAddressesOrderer = function() {
|
||||
return this.publicKeyRing.getAddressesOrderer(this.publicKey);
|
||||
Wallet.prototype.getAddressesOrdered = function() {
|
||||
return this.publicKeyRing.getAddressesOrdered(this.publicKey);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue