Skip to content

Commit 8f42d19

Browse files
committed
add a rate limit-set on decrease take (avoids close increase)
1 parent 3d53926 commit 8f42d19

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pallets/subtensor/src/staking/decrease_take.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@ impl<T: Config> Pallet<T> {
5757
// --- 4. Set the new take value.
5858
Delegates::<T>::insert(hotkey.clone(), take);
5959

60-
// --- 5. Emit the take value.
60+
// --- 5. Set last block for rate limiting
61+
let block: u64 = Self::get_current_block_as_u64();
62+
Self::set_last_tx_block_delegate_take(&hotkey, block);
63+
64+
// --- 6. Emit the take value.
6165
log::debug!(
6266
"TakeDecreased( coldkey:{:?}, hotkey:{:?}, take:{:?} )",
6367
coldkey,

0 commit comments

Comments
 (0)