Merge pull request #237 from braydonf/tip-error

Database: Warn about inconsistent database state.
This commit is contained in:
Chris Kleeschulte 2015-09-18 09:59:54 -04:00
commit 5451a9033e

View File

@ -122,6 +122,10 @@ DB.prototype.start = function(callback) {
} else {
self.getBlock(metadata.tip, function(err, tip) {
if(err) {
log.warn(
'Database is in an inconsistent state, a reindex is needed. Could not get current tip:',
metadata.tip
);
return callback(err);
}
self.tip = tip;