diff --git a/lib/blockchainmonitor.js b/lib/blockchainmonitor.js index 8e8a551..c0d6336 100644 --- a/lib/blockchainmonitor.js +++ b/lib/blockchainmonitor.js @@ -83,7 +83,7 @@ BlockchainMonitor.prototype._initExplorer = function(explorer) { log.error('Error connecting to ' + explorer.getConnectionInfo()); }); socket.on('tx', _.bind(self._handleIncommingTx, self)); - socket.on('block', _.bind(self._handleNewBlock, self)); + socket.on('block', _.bind(self._handleNewBlock, self, explorer.network)); }; BlockchainMonitor.prototype._handleTxId = function(data, processIt) { @@ -177,12 +177,13 @@ BlockchainMonitor.prototype._handleIncommingTx = function(data) { this._handleTxOuts(data); }; -BlockchainMonitor.prototype._handleNewBlock = function(hash) { +BlockchainMonitor.prototype._handleNewBlock = function(network, hash) { var self = this; - log.info('New block: ', hash); + log.info('New ' + network + ' block: ', hash); var notification = Notification.create({ type: 'NewBlock', + walletId: network, // use network name as wallet id for global notifications data: { hash: hash, },