Fixed issue with missing header on log entry.
This commit is contained in:
parent
d7fb9e9c27
commit
aa6570d23a
@ -854,11 +854,21 @@ BlockService.prototype._logSynced = function(blockHash) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
|
||||
if (!header) {
|
||||
return next();
|
||||
}
|
||||
|
||||
blockHeight = header.height;
|
||||
next(null, header.prevHash);
|
||||
});
|
||||
},
|
||||
function(prevBlockHash, next) {
|
||||
|
||||
if (!prevBlockHash) {
|
||||
return next();
|
||||
}
|
||||
|
||||
self._getTimeSinceLastBlock(blockHash, prevBlockHash, function(err, diff) {
|
||||
|
||||
if (err) {
|
||||
|
||||
@ -590,6 +590,10 @@ HeaderService.prototype._getHeader = function(height, hash, callback) {
|
||||
return callback(new Error('invalid arguments'));
|
||||
}
|
||||
|
||||
if (height === self._lastHeader.height || hash === self._lastHeader.hash) {
|
||||
return callback(null, self._lastHeader);
|
||||
}
|
||||
|
||||
var key;
|
||||
if (hash) {
|
||||
key = self._encoding.encodeHeaderHashKey(hash);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user