Skip to content

Commit

Permalink
only remove from stakinghotkeys if global==0
Browse files Browse the repository at this point in the history
  • Loading branch information
camfairchild committed Oct 29, 2024
1 parent bac35f9 commit fc7d4ef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pallets/subtensor/src/staking/stake_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,8 @@ impl<T: Config> Pallet<T> {

// Step 15: Decrease total stake across all subnets
TotalStake::<T>::put(TotalStake::<T>::get().saturating_sub(tao_unstaked_u64));
// Step 16: Update StakingHotkeys if the hotkey's total alpha is zero
if Alpha::<T>::get((hotkey, coldkey, netuid)) == 0 {
// Step 16: Update StakingHotkeys if the hotkey's total alpha, across all subnets, is zero
if Self::get_global_for_hotkey_and_coldkey(hotkey, coldkey) == 0 {
StakingHotkeys::<T>::mutate(coldkey, |hotkeys| {
hotkeys.retain(|k| k != hotkey);
});
Expand Down

0 comments on commit fc7d4ef

Please sign in to comment.