From 6c44a594f4423664cc363ea4e9e50223a4597139 Mon Sep 17 00:00:00 2001 From: Sina Mahmoodi Date: Mon, 5 Feb 2024 18:29:53 +0100 Subject: [PATCH] fix self destruct burn condition --- core/state/statedb.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/state/statedb.go b/core/state/statedb.go index 7dc346bf1a..42daa16c2a 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -881,7 +881,7 @@ func (s *StateDB) Finalise(deleteEmptyObjects bool) { obj.deleted = true // If ether was sent to account post-selfdestruct it is burnt. - if bal := obj.Balance(); bal.Sign() != 0 && s.logger != nil { + if bal := obj.Balance(); s.logger != nil && obj.selfDestructed && bal.Sign() != 0 { s.logger.OnBalanceChange(obj.address, bal.ToBig(), new(big.Int), BalanceDecreaseSelfdestructBurn) } // We need to maintain account deletions explicitly (will remain