@@ -1826,10 +1826,11 @@ def create_or_delete_pow_records(self, tx_hash, tx_num, height, operations_found
1826
1826
# Exclude candidates that are earlier than MINT_SUBNAME_COMMIT_PAYMENT_DELAY_BLOCKS blocks
1827
1827
# of the current batch of candidates. For example: [808202, 808203, 808254, 808255] will return [808254, 808255]
1828
1828
# This will only affect session queries, regardless of indexing.
1829
- def exclude_outdated_candidates (self , all_entries ):
1829
+ def exclude_outdated_candidates (self , all_entries : List [dict ]):
1830
+ entries = all_entries .copy ()
1830
1831
potential_exclude_entries = []
1831
1832
earliest_height = 0
1832
- for entry in all_entries :
1833
+ for entry in entries :
1833
1834
_ , height_info = self .build_candidate_heights_info (entry )
1834
1835
commit_height = height_info ['commit_height' ]
1835
1836
if earliest_height == 0 :
@@ -1838,10 +1839,11 @@ def exclude_outdated_candidates(self, all_entries):
1838
1839
continue
1839
1840
if commit_height - earliest_height > MINT_SUBNAME_COMMIT_PAYMENT_DELAY_BLOCKS :
1840
1841
for old_entry in potential_exclude_entries :
1841
- all_entries .remove (old_entry )
1842
+ entries .remove (old_entry )
1842
1843
potential_exclude_entries .clear ()
1843
1844
earliest_height = commit_height
1844
1845
potential_exclude_entries .append (entry )
1846
+ return entries
1845
1847
1846
1848
# Get the effective realm considering cache and database
1847
1849
def get_effective_realm (self , realm_name , height ):
@@ -1876,7 +1878,7 @@ def get_effective_subrealm(self, parent_realm_id, subrealm_name, height):
1876
1878
if len (all_entries ) == 0 :
1877
1879
return None , None , []
1878
1880
all_entries .sort (key = lambda x : x ['tx_num' ])
1879
- self .exclude_outdated_candidates (all_entries )
1881
+ all_entries = self .exclude_outdated_candidates (all_entries )
1880
1882
for index , entry in enumerate (all_entries ):
1881
1883
atomical_id = entry ['value' ]
1882
1884
mint_info = self .get_atomicals_id_mint_info (atomical_id , False )
@@ -1964,7 +1966,7 @@ def get_effective_dmitem(self, parent_container_id, dmitem_name, current_height)
1964
1966
if len (all_entries ) == 0 :
1965
1967
return None , None , []
1966
1968
all_entries .sort (key = lambda x : x ['tx_num' ])
1967
- self .exclude_outdated_candidates (all_entries )
1969
+ all_entries = self .exclude_outdated_candidates (all_entries )
1968
1970
for index , entry in enumerate (all_entries ):
1969
1971
atomical_id = entry ['value' ]
1970
1972
mint_info = self .get_atomicals_id_mint_info (atomical_id , False )
@@ -2038,7 +2040,7 @@ def get_effective_name_template(self, db_prefix, subject, height, name_data_cach
2038
2040
all_entries .extend (db_entries )
2039
2041
# sort by the earliest tx number because it was the first one committed
2040
2042
all_entries .sort (key = lambda x : x ['tx_num' ])
2041
- self .exclude_outdated_candidates (all_entries )
2043
+ all_entries = self .exclude_outdated_candidates (all_entries )
2042
2044
if len (all_entries ) > 0 :
2043
2045
candidate_entry = all_entries [0 ]
2044
2046
atomical_id = candidate_entry ['value' ]
@@ -2389,7 +2391,7 @@ def get_container_dmint_status_for_atomical_id(self, atomical_id, latest_state):
2389
2391
return dmint_format_status
2390
2392
2391
2393
# Convert candidates to heights info.
2392
- def build_candidate_heights_info (self , raw_candidate_entry ):
2394
+ def build_candidate_heights_info (self , raw_candidate_entry : dict ):
2393
2395
candidate_atomical_id = raw_candidate_entry ['value' ]
2394
2396
raw_mint_info_for_candidate_id = self .get_atomicals_id_mint_info (candidate_atomical_id , True )
2395
2397
return candidate_atomical_id , {
0 commit comments