diff --git a/triedb/pathdb/journal.go b/triedb/pathdb/journal.go index 581014f7e..c16807e99 100644 --- a/triedb/pathdb/journal.go +++ b/triedb/pathdb/journal.go @@ -66,7 +66,7 @@ type nblJournalData struct { root common.Hash layers uint64 size uint64 - // nodes []journalNodes + nodes []journalNodes } // journalAccounts represents a list accounts belong to the layer. @@ -518,9 +518,15 @@ func (dl *diskLayer) journal(w io.Writer, journalType JournalType) error { log.Info("print journal multi layers node info", "index", i, "root", val.root, "layers", val.layers, "size", val.size) } - layerNum := dl.buffer.getLayers() - log.Info("print journal layers", "layer", layerNum) - if err := rlp.Encode(journalBuf, layerNum); err != nil { + var nodeCopy []nblJournalData + copy(nodeCopy, nodes) + for i, val := range nodeCopy { + log.Info("print nodeCopy multi layers node info", "index", i, "root", val.root, "layers", val.layers, + "size", val.size) + } + // layerNum := dl.buffer.getLayers() + // log.Info("print journal layers", "layer", layerNum) + if err := rlp.Encode(journalBuf, nodeCopy); err != nil { return err } log.Info("Journal file and node buffer list", "multi layer nodes count", len(nodes)) diff --git a/triedb/pathdb/nodebufferlist.go b/triedb/pathdb/nodebufferlist.go index d558d0991..d889cc799 100644 --- a/triedb/pathdb/nodebufferlist.go +++ b/triedb/pathdb/nodebufferlist.go @@ -577,7 +577,7 @@ func (nf *nodebufferlist) getMultiLayerNodes() []nblJournalData { root: nf.base.root, layers: nf.base.layers, size: nf.base.size, - // nodes: compressTrieNodes(nf.base.nodes), + nodes: compressTrieNodes(nf.base.nodes), }) log.Info("getMultiLayerNodes base", "state_id", nf.base.id, "root", nf.base.root, "layers", nf.base.layers, "size", nf.base.size) @@ -589,7 +589,7 @@ func (nf *nodebufferlist) getMultiLayerNodes() []nblJournalData { root: buffer.root, layers: buffer.layers, size: buffer.size, - // nodes: compressTrieNodes(buffer.nodes), + nodes: compressTrieNodes(buffer.nodes), }) return true }