Skip to content

Commit 163c3f7

Browse files
committed
Fix Bonds cleanup on subnet removal
1 parent 9ddf6dc commit 163c3f7

File tree

1 file changed

+4
-1
lines changed
  • pallets/subtensor/src/coinbase

1 file changed

+4
-1
lines changed

pallets/subtensor/src/coinbase/root.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,10 @@ impl<T: Config> Pallet<T> {
430430
let _ = Uids::<T>::clear_prefix(netuid, u32::MAX, None);
431431
let keys = Keys::<T>::iter_prefix(netuid).collect::<Vec<_>>();
432432
let _ = Keys::<T>::clear_prefix(netuid, u32::MAX, None);
433-
let _ = Bonds::<T>::clear_prefix(NetUidStorageIndex::from(netuid), u32::MAX, None);
433+
for subid in 0..subsubnets {
434+
let netuid_index = Self::get_subsubnet_storage_index(netuid, subid.into());
435+
let _ = Bonds::<T>::clear_prefix(netuid_index, u32::MAX, None);
436+
}
434437

435438
// --- 8. Removes the weights for this subnet (do not remove).
436439
for subid in 0..subsubnets {

0 commit comments

Comments
 (0)