Skip to content

Commit

Permalink
Add more action details
Browse files Browse the repository at this point in the history
  • Loading branch information
mvines committed Jun 2, 2021
1 parent 555d435 commit 8767418
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions bot/src/stake_pool_v0.rs
Original file line number Diff line number Diff line change
Expand Up @@ -536,12 +536,17 @@ fn create_validator_stake_accounts(
}
}
} else {
if reserve_stake_balance < MIN_STAKE_ACCOUNT_BALANCE {
let action = if reserve_stake_balance < MIN_STAKE_ACCOUNT_BALANCE {
// Try again next epoch
warn!(
"Insufficient funds in reserve stake account to create stake account: {} required, {} balance",
Sol(MIN_STAKE_ACCOUNT_BALANCE), Sol(reserve_stake_balance)
);

format!(
"insufficient funds in reserve account to create stake account {}",
stake_address
)
} else {
// Create a stake account for the validator
reserve_stake_balance -= MIN_STAKE_ACCOUNT_BALANCE;
Expand All @@ -564,15 +569,8 @@ fn create_validator_stake_accounts(
&instructions,
Some(&authorized_staker.pubkey()),
));
debug!(
"Creating stake account for validator {} ({})",
identity, stake_address
);
}
let action = format!(
"stake account busy due to no stake account: {}",
stake_address
);
format!("creating new stake account {}", stake_address)
};
warn!("Busy validator {}: {}", *identity, action);
validator_stake_actions.insert(*identity, action);
}
Expand Down

0 comments on commit 8767418

Please sign in to comment.