Skip to content

Commit

Permalink
Add ADD_RENT_EXEMPT_MINIMUM env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-at-planetariummusic committed Dec 20, 2023
1 parent 183b7a9 commit 3717a82
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions bot/src/stake_pool_v0.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use solana_sdk::instruction::Instruction;
use solana_sdk::system_instruction;
use std::env;
use {
crate::{
generic_stake_pool::*,
Expand Down Expand Up @@ -727,11 +728,16 @@ where
} else {
deactivating_total += amount_to_remove;

let mut instructions: Vec<Instruction> = vec![system_instruction::transfer(
&authorized_staker.pubkey(),
&transient_stake_address,
DELEGATION_RENT,
)];
let mut instructions: Vec<Instruction> = vec![];

// Testnet now requires that stake accounts have a rent-exempt minimum
if env::var("ADD_RENT_EXEMPT_MINIMUM").is_ok() {
instructions.push(system_instruction::transfer(
&authorized_staker.pubkey(),
&transient_stake_address,
DELEGATION_RENT,
));
}

instructions.append(&mut stake_instruction::split_with_seed(
&stake_address,
Expand Down

0 comments on commit 3717a82

Please sign in to comment.