We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f6de9ed commit 632ee45Copy full SHA for 632ee45
program/rust/src/validator.rs
@@ -170,10 +170,12 @@ pub fn compute_publisher_stake_caps<'a>(
170
.checked_div(max(u64::from(price_account.num_), z))
171
.unwrap_or(0);
172
for i in 0..(price_account.num_ as usize) {
173
- publisher_caps
174
- .entry(price_account.comp_[i].pub_)
175
- .and_modify(|e: &mut u64| *e = e.saturating_add(cap))
176
- .or_insert(cap);
+ if let Some(pub_) = price_account.comp_.get(i).map(|comp| &comp.pub_) {
+ publisher_caps
+ .entry(*pub_)
+ .and_modify(|e: &mut u64| *e = e.saturating_add(cap))
177
+ .or_insert(cap);
178
+ }
179
}
180
181
0 commit comments