Skip to content

Commit

Permalink
checks if the pool is enabled or disabled before match
Browse files Browse the repository at this point in the history
  • Loading branch information
akshay111meher committed Nov 16, 2024
1 parent 84b2483 commit 717c071
Showing 1 changed file with 27 additions and 4 deletions.
31 changes: 27 additions & 4 deletions matching_engine/src/jobs/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,12 +393,35 @@ impl LogParser {
let mut cached_stake = {
let mut m = HashMap::new();
for _generator in all_generators.clone() {
let available_stake = generator_store
.get_available_native_stake(&_generator)
.unwrap_or_default()
+ generator_store
let available_stake = {
let available_native_stake = generator_store
.get_available_native_stake(&_generator)
.unwrap_or_default();
let available_symbiotic_stake = generator_store
.get_available_symbiotic_stake(&_generator)
.unwrap_or_default();

let mut available_stake = TokenTracker::new();

if self
.shared_stake_manager_store
.read()
.await
.exists(&self.native_staking.address())
{
available_stake += available_native_stake;
}

if self
.shared_stake_manager_store
.read()
.await
.exists(&self.symbiotic_staking.address())
{
available_stake += available_symbiotic_stake;
}
available_stake
};
m.insert(_generator, available_stake);
}
m
Expand Down

0 comments on commit 717c071

Please sign in to comment.