Skip to content

Commit 24a1334

Browse files
author
µ
committed
run_coinbase(): make total_moving_prices immutable
1 parent 03dbf4f commit 24a1334

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pallets/subtensor/src/coinbase/run_coinbase.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,14 @@ impl<T: Config> Pallet<T> {
3939
log::debug!("Subnets to emit to: {subnets_to_emit_to:?}");
4040

4141
// --- 2. Get sum of tao reserves ( in a later version we will switch to prices. )
42-
let mut total_moving_prices = U96F32::saturating_from_num(0.0);
42+
let mut acc_total_moving_prices = U96F32::saturating_from_num(0.0);
4343
// Only get price EMA for subnets that we emit to.
4444
for netuid_i in subnets_to_emit_to.iter() {
4545
// Get and update the moving price of each subnet adding the total together.
46-
total_moving_prices =
47-
total_moving_prices.saturating_add(Self::get_moving_alpha_price(*netuid_i));
46+
acc_total_moving_prices =
47+
acc_total_moving_prices.saturating_add(Self::get_moving_alpha_price(*netuid_i));
4848
}
49+
let total_moving_prices = acc_total_moving_prices;
4950
log::debug!("total_moving_prices: {total_moving_prices:?}");
5051

5152
// --- 3. Get subnet terms (tao_in, alpha_in, and alpha_out)

0 commit comments

Comments
 (0)