File tree Expand file tree Collapse file tree 1 file changed +3
-21
lines changed
pallets/subtensor/src/subnets Expand file tree Collapse file tree 1 file changed +3
-21
lines changed Original file line number Diff line number Diff line change @@ -425,29 +425,11 @@ impl<T: Config> Pallet<T> {
425
425
return 0 ; // If there are no neurons in this network.
426
426
}
427
427
428
- // Get SN owner top stake hotkey
429
- let mut top_stake_sn_owner_hotkey: Option < T :: AccountId > = None ;
430
- let mut max_stake_weight: I64F64 = I64F64 :: from_num ( -1 ) ;
431
428
for neuron_uid in 0 ..neurons_n {
429
+ // Do not deregister the owner's hotkey from the `SubnetOwnerHotkey` map
432
430
if let Ok ( hotkey) = Self :: get_hotkey_for_net_and_uid ( netuid, neuron_uid) {
433
- let coldkey = Self :: get_owning_coldkey_for_hotkey ( & hotkey) ;
434
- if Self :: get_subnet_owner ( netuid) != coldkey {
435
- continue ;
436
- }
437
-
438
- let stake_weights = Self :: get_stake_weights_for_hotkey_on_subnet ( & hotkey, netuid) ;
439
- if stake_weights. 0 > max_stake_weight {
440
- max_stake_weight = stake_weights. 0 ;
441
- top_stake_sn_owner_hotkey = Some ( hotkey) ;
442
- }
443
- }
444
- }
445
-
446
- for neuron_uid in 0 ..neurons_n {
447
- // Do not deregister the owner's top-stake hotkey
448
- if let Ok ( hotkey) = Self :: get_hotkey_for_net_and_uid ( netuid, neuron_uid) {
449
- if let Some ( ref top_sn_owner_hotkey) = top_stake_sn_owner_hotkey {
450
- if top_sn_owner_hotkey == & hotkey {
431
+ if let Ok ( top_sn_owner_hotkey) = SubnetOwnerHotkey :: < T > :: try_get ( netuid) {
432
+ if top_sn_owner_hotkey == hotkey {
451
433
continue ;
452
434
}
453
435
}
You can’t perform that action at this time.
0 commit comments