File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
pallets/subtensor/src/migrations Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -98,8 +98,12 @@ pub fn migrate_rao<T: Config>() -> Weight {
98
98
SubnetOwnerHotkey :: < T > :: insert ( netuid, owner_coldkey. clone ( ) ) ;
99
99
// Associate the coldkey to coldkey.
100
100
Pallet :: < T > :: create_account_if_non_existent ( & owner_coldkey, & owner_coldkey) ;
101
- // Register the owner_coldkey as neuron to the network.
102
- let _neuron_uid: u16 = Pallet :: < T > :: register_neuron ( * netuid, & owner_coldkey) ;
101
+
102
+ // Only register the owner coldkey if it's not already a hotkey on the subnet.
103
+ if !Uids :: < T > :: contains_key ( * netuid, & owner_coldkey) {
104
+ // Register the owner_coldkey as neuron to the network.
105
+ let _neuron_uid: u16 = Pallet :: < T > :: register_neuron ( * netuid, & owner_coldkey) ;
106
+ }
103
107
// Register the neuron immediately.
104
108
if !Identities :: < T > :: contains_key ( owner_coldkey. clone ( ) ) {
105
109
// Set the identitiy for the Owner coldkey if non existent.
You can’t perform that action at this time.
0 commit comments