diff --git a/core/state/statedb.go b/core/state/statedb.go index cdcec5260616..47f30f9d632e 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -514,7 +514,7 @@ func (s *StateDB) deleteStateObject(obj *stateObject) { defer func(start time.Time) { s.AccountUpdates += time.Since(start) }(time.Now()) } // Delete the account from the trie - if false { + if !s.trie.IsVerkle() { addr := obj.Address() if err := s.trie.TryDelete(addr[:]); err != nil { s.setError(fmt.Errorf("deleteStateObject (%x) error: %v", addr[:], err)) diff --git a/core/state_processor_test.go b/core/state_processor_test.go index 8bec46be4bc9..f4da1f44f8e2 100644 --- a/core/state_processor_test.go +++ b/core/state_processor_test.go @@ -325,8 +325,11 @@ func TestProcessStateless(t *testing.T) { blockchain, _ := NewBlockChain(db, nil, gspec.Config, ethash.NewFaker(), vm.Config{}, nil, nil) defer blockchain.Stop() chain, _ := GenerateVerkleChain(gspec.Config, genesis, ethash.NewFaker(), db, 1, func(_ int, gen *BlockGen) { - toaddr := common.Address{} - tx, _ := types.SignTx(types.NewTransaction(0, toaddr, big.NewInt(0), params.TxGas, big.NewInt(875000000), nil), signer, testKey) + tx, _ := types.SignTx(types.NewTransaction(0, common.Address{1, 2, 3}, big.NewInt(999), params.TxGas, big.NewInt(875000000), nil), signer, testKey) + gen.AddTx(tx) + tx, _ = types.SignTx(types.NewTransaction(1, common.Address{}, big.NewInt(999), params.TxGas, big.NewInt(875000000), nil), signer, testKey) + gen.AddTx(tx) + tx, _ = types.SignTx(types.NewTransaction(2, common.Address{}, big.NewInt(0), params.TxGas, big.NewInt(875000000), nil), signer, testKey) gen.AddTx(tx) })