Snapshot fixes and optimizations (#2863)
This commit is contained in:
@@ -348,13 +348,13 @@ impl JournalDB for OverlayRecentDB {
|
||||
match rc {
|
||||
0 => {}
|
||||
1 => {
|
||||
if try!(self.backing.get(self.column, &key)).is_some() {
|
||||
if cfg!(debug_assertions) && try!(self.backing.get(self.column, &key)).is_some() {
|
||||
return Err(BaseDataError::AlreadyExists(key).into());
|
||||
}
|
||||
batch.put(self.column, &key, &value)
|
||||
}
|
||||
-1 => {
|
||||
if try!(self.backing.get(self.column, &key)).is_none() {
|
||||
if cfg!(debug_assertions) && try!(self.backing.get(self.column, &key)).is_none() {
|
||||
return Err(BaseDataError::NegativelyReferencedHash(key).into());
|
||||
}
|
||||
batch.delete(self.column, &key)
|
||||
|
||||
Reference in New Issue
Block a user