chaindb: fix reset atomicity.
This commit is contained in:
parent
ae2f90890a
commit
28acda024a
@ -224,12 +224,13 @@ ChainDB.prototype._open = function open(callback) {
|
||||
return callback(err);
|
||||
|
||||
self.logger.info('Chain successfully loaded.');
|
||||
self.logger.info('Chain State: hash=%s tx=%d coin=%d value=%s.',
|
||||
|
||||
self.logger.info(
|
||||
'Chain State: hash=%s tx=%d coin=%d value=%s.',
|
||||
self.state.rhash,
|
||||
self.state.tx,
|
||||
self.state.coin,
|
||||
utils.btc(self.state.value)
|
||||
);
|
||||
utils.btc(self.state.value));
|
||||
|
||||
self.db.checkVersion('V', 1, callback);
|
||||
}
|
||||
@ -846,6 +847,8 @@ ChainDB.prototype.reset = function reset(block, callback) {
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
self.put(layout.R, self.pending.commit(tip.prevBlock));
|
||||
|
||||
self.commit(function(err) {
|
||||
if (err)
|
||||
return next(err);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user