changing typeof to equivalent lodash
This commit is contained in:
parent
df7710ded1
commit
0a3a1b5ea6
@ -180,7 +180,7 @@ AddressService.prototype.getAddressHistory = function(addresses, options, stream
|
||||
//options.from = options.from || 0; //Deprecated, use `after` option
|
||||
//options.to = options.to || 0xffffffff; //Deprecated, use `after` option
|
||||
|
||||
if(typeof callback !== 'function'){ //if only 3 args, then streamer is callback
|
||||
if(!_.isFunction(callback)){ //if only 3 args, then streamer is callback
|
||||
callback = streamer;
|
||||
streamer = () => null; //NULL fn
|
||||
}
|
||||
@ -319,7 +319,7 @@ AddressService.prototype.getAddressSummary = function(address, options, streamer
|
||||
options.queryMempool = true;
|
||||
}
|
||||
|
||||
if(typeof callback !== 'function'){ //if only 3 args, then streamer is callback
|
||||
if(!_.isFunction(callback)){ //if only 3 args, then streamer is callback
|
||||
callback = streamer;
|
||||
streamer = () => null; //NULL fn
|
||||
}
|
||||
|
||||
@ -724,13 +724,13 @@ BlockService.prototype._findLatestValidBlockHeader = function(callback) {
|
||||
// if some joker mines a block using an orphan block as its prev block, then the effect of this will be
|
||||
// us detecting a reorg, but not actually reorging anything
|
||||
// FLOSight Error Correction from RanchiMall 17th May 2021. removed the unhandled assert and replaced by looging of error
|
||||
if (typeof header !== 'undefined') {
|
||||
if (!_.isUndefined(header)) {
|
||||
if (header == false) {
|
||||
log.error('Block Service: we could not locate any of our recent block hashes in the header service ' + 'index. Perhaps our header service sync\'ed to the wrong chain?');
|
||||
}
|
||||
}
|
||||
// assert(header, 'Block Service: we could not locate any of our recent block hashes in the header service ' + 'index. Perhaps our header service sync\'ed to the wrong chain?');
|
||||
if (typeof header.height !== 'undefined') {
|
||||
if (!_.isUndefined(header.height)) {
|
||||
if (header.height > self._tip.height) {
|
||||
log.error('Block Service: we found a common ancestor header whose ' + 'height was greater than our current tip. This should be impossible.');
|
||||
}
|
||||
|
||||
@ -95,7 +95,7 @@ DB.prototype.get = function(key, options, callback) {
|
||||
var cb = callback;
|
||||
var opts = options;
|
||||
|
||||
if (typeof callback !== 'function') {
|
||||
if (!_.isFunction(callback)) {
|
||||
cb = options;
|
||||
opts = {};
|
||||
}
|
||||
|
||||
@ -114,7 +114,7 @@ TransactionService.prototype.getTransaction = function(txid, options, callback)
|
||||
|
||||
var self = this;
|
||||
|
||||
if (typeof callback !== 'function') {
|
||||
if (!_.isFunction(callback)) {
|
||||
callback = options;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user