mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-11 23:31:07 +00:00
State-db refactoring (#12239)
* Prune discarded blocks immediately * state-db refactoring part 1 * Some renames * Get rid of pending state * Revert "Prune discarded blocks immediately" This reverts commit b60d98c569e8af18d99087da93f0911d4f24006e. * Cleanup * Make clippy happy * Minor changes
This commit is contained in:
@@ -1994,15 +1994,15 @@ impl<Block: BlockT> sc_client_api::backend::Backend<Block> for Backend<Block> {
|
||||
let usage = operation.old_state.usage_info();
|
||||
self.state_usage.merge_sm(usage);
|
||||
|
||||
match self.try_commit_operation(operation) {
|
||||
Ok(_) => {
|
||||
self.storage.state_db.apply_pending();
|
||||
Ok(())
|
||||
},
|
||||
e @ Err(_) => {
|
||||
self.storage.state_db.revert_pending();
|
||||
e
|
||||
},
|
||||
if let Err(e) = self.try_commit_operation(operation) {
|
||||
let state_meta_db = StateMetaDb(self.storage.db.clone());
|
||||
self.storage
|
||||
.state_db
|
||||
.reset(state_meta_db)
|
||||
.map_err(sp_blockchain::Error::from_state_db)?;
|
||||
Err(e)
|
||||
} else {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user