@@ -608,21 +608,6 @@ impl TopLevelState {
608608 /// First searches for account in the local, then the shared cache.
609609 /// Populates local cache if nothing found.
610610 fn ensure_account_cached < F , U > ( & self , a : & Address , f : F ) -> TrieResult < U >
611- where
612- F : Fn ( Option < & Account > ) -> U , {
613- let a = if self . regular_account_exists_and_not_null ( a) ? {
614- let regular_account = self . require_regular_account_from_address ( a) ?;
615- public_to_address ( & regular_account. owner_public ( ) )
616- } else {
617- a. clone ( )
618- } ;
619-
620- self . ensure_master_account_cached ( & a, f)
621- }
622-
623- /// Same with ensure_master_account.
624- /// But do not pass regular_account redirection
625- fn ensure_master_account_cached < F , U > ( & self , a : & Address , f : F ) -> TrieResult < U >
626611 where
627612 F : Fn ( Option < & Account > ) -> U , {
628613 let db = TrieFactory :: readonly ( self . db . as_hashdb ( ) , & self . root ) ?;
@@ -736,10 +721,6 @@ impl TopState<StateDB> for TopLevelState {
736721 self . ensure_account_cached ( a, |a| a. map_or ( false , |a| !a. nonce ( ) . is_zero ( ) ) )
737722 }
738723
739- fn master_account_exists_and_not_null ( & self , a : & Address ) -> TrieResult < bool > {
740- self . ensure_master_account_cached ( a, |a| a. map_or ( false , |a| !a. is_null ( ) ) )
741- }
742-
743724 fn regular_account_exists_and_not_null ( & self , a : & Address ) -> TrieResult < bool > {
744725 self . ensure_regular_account_cached ( a, |a| a. map_or ( false , |a| !a. is_null ( ) ) )
745726 }
@@ -800,7 +781,7 @@ impl TopState<StateDB> for TopLevelState {
800781 return Err ( ParcelError :: RegularKeyAlreadyInUse . into ( ) )
801782 }
802783
803- if self . master_account_exists_and_not_null ( & regular_address) ? {
784+ if self . account_exists_and_not_null ( & regular_address) ? {
804785 return Err ( ParcelError :: RegularKeyAlreadyInUseAsMaster . into ( ) )
805786 }
806787
0 commit comments