fix subcribe

This commit is contained in:
Matias Alejo Garcia 2014-11-12 18:32:18 -03:00
commit 4c61c74706
4 changed files with 20 additions and 15 deletions

View file

@ -812,6 +812,7 @@ Wallet.prototype._lockIncomming = function() {
Wallet.prototype._setBlockchainListeners = function() {
var self = this;
self.blockchain.removeAllListeners();
self.subscribeToAddresses();
log.debug('Setting Blockchain listeners for', this.getName());
self.blockchain.on('reconnect', function(attempts) {
@ -2179,6 +2180,7 @@ Wallet.prototype.getAddressesStr = function(opts) {
Wallet.prototype.subscribeToAddresses = function() {
var addrInfo = this.publicKeyRing.getAddressesInfo();
console.log('[Wallet.js.2181:addrInfo:]',addrInfo); //TODO
this.blockchain.subscribe(_.pluck(addrInfo, 'addressStr'));
log.debug('Subscribed to ' + addrInfo.length + ' addresses'); //TODO
};