store new block notifications with walletId=network
This commit is contained in:
parent
781f2c44b7
commit
bee66435e9
|
@ -83,7 +83,7 @@ BlockchainMonitor.prototype._initExplorer = function(explorer) {
|
||||||
log.error('Error connecting to ' + explorer.getConnectionInfo());
|
log.error('Error connecting to ' + explorer.getConnectionInfo());
|
||||||
});
|
});
|
||||||
socket.on('tx', _.bind(self._handleIncommingTx, self));
|
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) {
|
BlockchainMonitor.prototype._handleTxId = function(data, processIt) {
|
||||||
|
@ -177,12 +177,13 @@ BlockchainMonitor.prototype._handleIncommingTx = function(data) {
|
||||||
this._handleTxOuts(data);
|
this._handleTxOuts(data);
|
||||||
};
|
};
|
||||||
|
|
||||||
BlockchainMonitor.prototype._handleNewBlock = function(hash) {
|
BlockchainMonitor.prototype._handleNewBlock = function(network, hash) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
log.info('New block: ', hash);
|
log.info('New ' + network + ' block: ', hash);
|
||||||
var notification = Notification.create({
|
var notification = Notification.create({
|
||||||
type: 'NewBlock',
|
type: 'NewBlock',
|
||||||
|
walletId: network, // use network name as wallet id for global notifications
|
||||||
data: {
|
data: {
|
||||||
hash: hash,
|
hash: hash,
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue