From 946ce1805d184065e0aabc9b70f05f55adf419ef Mon Sep 17 00:00:00 2001 From: VM Date: Mon, 9 Sep 2024 21:20:39 +0800 Subject: [PATCH] test: fix pathdb unit test --- triedb/pathdb/nodebufferlist.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/triedb/pathdb/nodebufferlist.go b/triedb/pathdb/nodebufferlist.go index 46a2396a2d..7defd1b691 100644 --- a/triedb/pathdb/nodebufferlist.go +++ b/triedb/pathdb/nodebufferlist.go @@ -460,14 +460,12 @@ func (nf *nodebufferlist) flush(db ethdb.KeyValueStore, clean *fastcache.Cache, return true } - log.Info("24nf2nu2") if !nf.isGenesis { nf.traverseReverse(commitFunc) } else { - log.Info("fme2iccmi2e") nf.forceFlush() } - log.Info("fm2o0923dfim") + persistID := nf.persistID + nf.base.layers err := nf.base.flush(nf.db, nf.clean, persistID) if err != nil { @@ -664,18 +662,14 @@ func (nf *nodebufferlist) traverseReverse(cb func(*multiDifflayer) bool) { return } +// forceFlush is used for init genesis func (nf *nodebufferlist) forceFlush() { commitFunc := func(buffer *multiDifflayer) bool { - log.Info("rj238328") - log.Info("dm392d29m") err := nf.base.commit(buffer.root, buffer.id, buffer.block, buffer.layers, buffer.nodes) - log.Info("dm329d23910") - log.Info("d23903d2i") if err != nil { log.Error("Failed to commit nodes to base node buffer", "error", err) return false } - log.Info("d3190120o") return false } nf.traverse(commitFunc)