Ivan Socolsky
9 years ago
No known key found for this signature in database
GPG Key ID: FAECE6A05FAA4F56
2 changed files with
9 additions and
4 deletions
-
lib/blockchainmonitor.js
-
lib/server.js
|
|
@ -205,6 +205,7 @@ BlockchainMonitor.prototype._handleNewBlock = function(network, hash) { |
|
|
|
walletId: network, // use network name as wallet id for global notifications
|
|
|
|
data: { |
|
|
|
hash: hash, |
|
|
|
network: network, |
|
|
|
}, |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
@ -157,7 +157,8 @@ WalletService.handleIncomingNotification = function(notification, cb) { |
|
|
|
cb = cb || function() {}; |
|
|
|
|
|
|
|
if (!notification || notification.type != 'NewBlock') return cb(); |
|
|
|
WalletService._clearBlockchainHeightCache(); |
|
|
|
|
|
|
|
WalletService._clearBlockchainHeightCache(notification.data.network); |
|
|
|
return cb(); |
|
|
|
}; |
|
|
|
|
|
|
@ -2458,10 +2459,13 @@ WalletService._initBlockchainHeightCache = function() { |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
WalletService._clearBlockchainHeightCache = function() { |
|
|
|
WalletService._clearBlockchainHeightCache = function(network) { |
|
|
|
WalletService._initBlockchainHeightCache(); |
|
|
|
WalletService._cachedBlockheight.livenet.current = null; |
|
|
|
WalletService._cachedBlockheight.testnet.current = null; |
|
|
|
if (!_.contains(['livenet', 'testnet'], network)) { |
|
|
|
log.error('Incorrect network in new block: ' + network); |
|
|
|
return; |
|
|
|
} |
|
|
|
WalletService._cachedBlockheight[network].current = null; |
|
|
|
}; |
|
|
|
|
|
|
|
WalletService.prototype._getBlockchainHeight = function(network, cb) { |
|
|
|