From 15ebc98877e7643d5ad24bc8fe332356c587d91a Mon Sep 17 00:00:00 2001 From: rakita Date: Fri, 25 Sep 2020 10:46:51 +0200 Subject: [PATCH] Drain the transaction overlay (#11654) (#59) --- ethcore/src/snapshot/mod.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ethcore/src/snapshot/mod.rs b/ethcore/src/snapshot/mod.rs index 324dcbeb1..76d2e2e56 100644 --- a/ethcore/src/snapshot/mod.rs +++ b/ethcore/src/snapshot/mod.rs @@ -499,8 +499,13 @@ impl StateRebuilder { account_trie.insert(&hash, &thin_rlp)?; } } - trace!(target: "snapshot", "current state root: {:?}", self.state_root); + + let backing = self.db.backing().clone(); + let mut batch = backing.transaction(); + // Drain the transaction overlay and put the data into the batch. + self.db.inject(&mut batch)?; + backing.write_buffered(batch); Ok(()) }