Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit f97c61a

Browse files
authored
stake-pool: Initialize all pool fields explicitly (#2523)
1 parent 50b5597 commit f97c61a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

stake-pool/program/src/processor.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -644,15 +644,17 @@ impl Processor {
644644
stake_pool.account_type = AccountType::StakePool;
645645
stake_pool.manager = *manager_info.key;
646646
stake_pool.staker = *staker_info.key;
647-
stake_pool.reserve_stake = *reserve_stake_info.key;
648647
stake_pool.stake_deposit_authority = stake_deposit_authority;
649648
stake_pool.stake_withdraw_bump_seed = stake_withdraw_bump_seed;
650649
stake_pool.validator_list = *validator_list_info.key;
650+
stake_pool.reserve_stake = *reserve_stake_info.key;
651651
stake_pool.pool_mint = *pool_mint_info.key;
652652
stake_pool.manager_fee_account = *manager_fee_info.key;
653653
stake_pool.token_program_id = *token_program_info.key;
654-
stake_pool.last_update_epoch = Clock::get()?.epoch;
655654
stake_pool.total_lamports = total_lamports;
655+
stake_pool.pool_token_supply = 0;
656+
stake_pool.last_update_epoch = Clock::get()?.epoch;
657+
stake_pool.lockup = stake_program::Lockup::default();
656658
stake_pool.epoch_fee = epoch_fee;
657659
stake_pool.next_epoch_fee = None;
658660
stake_pool.preferred_deposit_validator_vote_address = None;
@@ -666,7 +668,9 @@ impl Processor {
666668
stake_pool.sol_referral_fee = referral_fee;
667669
stake_pool.sol_withdraw_authority = None;
668670
stake_pool.sol_withdrawal_fee = withdrawal_fee;
669-
stake_pool.next_stake_withdrawal_fee = None;
671+
stake_pool.next_sol_withdrawal_fee = None;
672+
stake_pool.last_epoch_pool_token_supply = 0;
673+
stake_pool.last_epoch_total_lamports = 0;
670674

671675
stake_pool
672676
.serialize(&mut *stake_pool_info.data.borrow_mut())

0 commit comments

Comments
 (0)