Skip to content

Commit 5b90ff5

Browse files
committed
fix(staking): query_power must take the max power out from the validator's stake entries
1 parent 62708fc commit 5b90ff5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

data_structures/src/staking/stakes.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,8 @@ where
310310
.map(|stake| stake.read_value().power(capability, epoch))
311311
.collect::<Vec<Power>>()
312312
.into_iter()
313-
.sum())
313+
.max()
314+
.unwrap_or_default())
314315
}
315316

316317
/// For a given capability, obtain the full list of positive stake entries reversely ordered by their power.

0 commit comments

Comments
 (0)