fix(chain): db isn't committed after reverted action
@@ -663,9 +663,16 @@ impl Chain {
self.revert_l1action(&db, reverted_action)?;
}
}
+
// update layer1 actions
for action in param.updates {
self.update_l1action(&db, action)?;
+ match self.last_sync_event() {
+ SyncEvent::Success => (),
+ _ => db.commit()?,
+ }
+ }
+
db.commit()?;
log::debug!("commit db after sync");
@@ -700,7 +707,6 @@ impl Chain {
current_account_root, expected_account_root,
"check account tree"
);
- }
Ok(())
}
