|
|
@ -137,13 +137,13 @@ Wallet.prototype.getPrivateKey = function(index) { |
|
|
|
} |
|
|
|
|
|
|
|
Wallet.prototype.getPrivateKeyForAddress = function(address) { |
|
|
|
if (includeAddress(this.addresses, address)) { |
|
|
|
if (this.addresses.indexOf(address) > -1) { |
|
|
|
var index = this.addresses.indexOf(address) |
|
|
|
|
|
|
|
return this.getPrivateKey(index) |
|
|
|
} |
|
|
|
|
|
|
|
if (includeAddress(this.changeAddresses, address)) { |
|
|
|
if (this.changeAddresses.indexOf(address) > -1) { |
|
|
|
var index = this.changeAddresses.indexOf(address) |
|
|
|
|
|
|
|
return this.getInternalPrivateKey(index) |
|
|
@ -266,7 +266,7 @@ function processTx(tx, isPending) { |
|
|
|
} |
|
|
|
|
|
|
|
var myAddresses = this.addresses.concat(this.changeAddresses) |
|
|
|
if (includeAddress(myAddresses, address)) { |
|
|
|
if (myAddresses.indexOf(address) > -1) { |
|
|
|
var output = txid + ':' + i |
|
|
|
|
|
|
|
this.outputs[output] = { |
|
|
@ -297,8 +297,4 @@ function processTx(tx, isPending) { |
|
|
|
}, this) |
|
|
|
} |
|
|
|
|
|
|
|
function includeAddress(addresses, address) { |
|
|
|
return addresses.indexOf(address) > -1 |
|
|
|
} |
|
|
|
|
|
|
|
module.exports = Wallet |
|
|
|