diff --git a/core/blockchain.go b/core/blockchain.go index 04ed4ac824..f58df07e44 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -1852,7 +1852,6 @@ func (bc *BlockChain) insertChain(chain types.Blocks, setHead bool) (int, error) } else { status, err = bc.writeBlockAndSetHead(block, receipts, logs, statedb, false) } - statedb.GetWitness().SetBlock(block) log.Info(fmt.Sprintf("block %d summary:\n%s", block.NumberU64(), statedb.GetWitness().Summary())) //state.DumpBlockWithWitnessToFile(statedb.GetWitness(), block) diff --git a/core/state/state_witness.go b/core/state/state_witness.go index 5269c44a73..6705a80b52 100644 --- a/core/state/state_witness.go +++ b/core/state/state_witness.go @@ -161,13 +161,9 @@ func (w Witness) Copy() Witness { panic("not implemented") } -func (w *Witness) Dump() { - for owner, al := range w.lists { - fmt.Printf("owner %x:\n", owner) - for path, node := range al { - fmt.Printf("%x: %x\n", []byte(path), node) - } - } +func (w *Witness) LogSizeWithBlock(b *types.Block) { + enc := w.EncodeRLP() + fmt.Printf("block %d witness+block size: %d\n", b.Number(), len(enc)) } func (w *Witness) Summary() string {