@@ -244,29 +244,6 @@ impl<'config> MemoryStackSubstate<'config> {
244244 self . known_account ( address) . and_then ( |acc| acc. code . clone ( ) )
245245 }
246246
247- #[ must_use]
248- pub fn known_empty ( & self , address : H160 ) -> Option < bool > {
249- if let Some ( account) = self . known_account ( address) {
250- if account. basic . balance != U256_ZERO {
251- return Some ( false ) ;
252- }
253-
254- if account. basic . nonce != U256_ZERO {
255- return Some ( false ) ;
256- }
257-
258- if let Some ( code) = & account. code {
259- return Some (
260- account. basic . balance == U256_ZERO
261- && account. basic . nonce == U256_ZERO
262- && code. is_empty ( ) ,
263- ) ;
264- }
265- }
266-
267- None
268- }
269-
270247 #[ must_use]
271248 pub fn known_storage ( & self , address : H160 , key : H256 ) -> Option < H256 > {
272249 if let Some ( value) = self . storages . get ( & ( address, key) ) {
@@ -620,14 +597,21 @@ impl<'config, B: Backend> StackState<'config> for MemoryStackState<'_, 'config,
620597 self . substate . exit_discard ( )
621598 }
622599
600+ #[ must_use]
623601 fn is_empty ( & self , address : H160 ) -> bool {
624- if let Some ( known_empty) = self . substate . known_empty ( address) {
625- return known_empty;
602+ if let Some ( account) = self . substate . known_account ( address) {
603+ if !account. basic . balance . is_zero ( ) || !account. basic . nonce . is_zero ( ) {
604+ return false ;
605+ }
606+
607+ if let Some ( code) = & account. code {
608+ return code. is_empty ( ) ;
609+ }
610+ return self . backend . code ( address) . is_empty ( ) ;
626611 }
627612
628- self . backend . basic ( address) . balance == U256_ZERO
629- && self . backend . basic ( address) . nonce == U256_ZERO
630- && self . backend . code ( address) . is_empty ( )
613+ let basic = self . backend . basic ( address) ;
614+ basic. balance . is_zero ( ) && basic. nonce . is_zero ( ) && self . backend . code ( address) . is_empty ( )
631615 }
632616
633617 fn deleted ( & self , address : H160 ) -> bool {
0 commit comments