performance: addressIsOwn piggybacking from addressToPath map on public key ring

This commit is contained in:
Esteban Ordano 2014-11-13 17:34:13 -03:00
commit 46fddba5cd
2 changed files with 9 additions and 15 deletions

View file

@ -2196,11 +2196,8 @@ Wallet.prototype.getAddressesInfo = function(opts) {
* @desc Returns true if a given address was generated by deriving our master public key
* @return {boolean}
*/
Wallet.prototype.addressIsOwn = function(addrStr, opts) {
var addrList = this.getAddressesStr(opts);
return _.any(addrList, function(value) {
return value === addrStr;
});
Wallet.prototype.addressIsOwn = function(addrStr) {
return !!this.publicKeyRing.addressToPath[addrStr];
};