fix memleak.
This commit is contained in:
parent
cc3db0583c
commit
08ccb4c6ee
@ -522,9 +522,13 @@ BlockDB.prototype.getCoinsByAddress = function getCoinsByAddress(addresses, opti
|
||||
});
|
||||
}
|
||||
|
||||
// iter.end() here?
|
||||
if (!key)
|
||||
return done();
|
||||
if (!key) {
|
||||
return iter.end(function(err) {
|
||||
if (err)
|
||||
return done(err);
|
||||
done();
|
||||
});
|
||||
}
|
||||
|
||||
parts = key.split('/');
|
||||
hash = parts[3];
|
||||
@ -656,9 +660,13 @@ BlockDB.prototype.getTXByAddress = function getTXByAddress(addresses, options, c
|
||||
});
|
||||
}
|
||||
|
||||
// iter.end() here?
|
||||
if (!key)
|
||||
return done();
|
||||
if (!key) {
|
||||
return iter.end(function(err) {
|
||||
if (err)
|
||||
return done(err);
|
||||
done();
|
||||
});
|
||||
}
|
||||
|
||||
hash = key.split('/')[3];
|
||||
record = self.parseOffset(value);
|
||||
@ -967,13 +975,17 @@ BlockDB.prototype.getHeight = function getHeight(callback) {
|
||||
|
||||
if (err) {
|
||||
return iter.end(function() {
|
||||
return callback(err);
|
||||
callback(err);
|
||||
});
|
||||
}
|
||||
|
||||
// iter.end() here?
|
||||
if (!key)
|
||||
return callback(null, maxHeight);
|
||||
if (!key) {
|
||||
return iter.end(function(err) {
|
||||
if (err)
|
||||
return callback(err);
|
||||
callback(null, maxHeight);
|
||||
});
|
||||
}
|
||||
|
||||
height = +key.split('/')[2];
|
||||
if (height > maxHeight)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user