Skip to content

Commit

Permalink
fix: retain stake pool with withdraw in invest pools
Browse files Browse the repository at this point in the history
  • Loading branch information
kingsleydon committed Dec 10, 2024
1 parent 45bd877 commit cb723b1
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions pallets/phala/src/compute/vault.rs
Original file line number Diff line number Diff line change
Expand Up @@ -425,23 +425,25 @@ pub mod pallet {
nft_id,
).expect("get nft should not fail: qed.");
let property = &property_guard.attr;
if !base_pool::is_nondust_balance(property.shares) {
let _ = base_pool::Pallet::<T>::burn_nft(
&base_pool::pallet_id::<T::AccountId>(),
stake_pool.basepool.cid,
nft_id,
);
false
total_shares += property.shares;
if base_pool::is_nondust_balance(property.shares) {
true
} else {
total_shares += property.shares;
base_pool::is_nondust_balance(total_shares)
if (!base_pool::is_nondust_balance(total_shares)) {
let _ = base_pool::Pallet::<T>::burn_nft(
&base_pool::pallet_id::<T::AccountId>(),
stake_pool.basepool.cid,
nft_id,
);
pools_to_remove.push(*pid);
}
false
}
} else {
false
};

if !should_withdraw {
pools_to_remove.push(*pid);
continue;
}

Expand Down

0 comments on commit cb723b1

Please sign in to comment.