Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
avoid marker
Browse files Browse the repository at this point in the history
  • Loading branch information
jackcmay committed Jul 14, 2021
1 parent e6f637b commit 795b81f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sdk/src/compute_budget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ pub fn process_request(
compute_budget: &mut BpfComputeBudget,
tx: &Transaction,
) -> Result<(), TransactionError> {
if !tx.message().instructions.is_empty() {
let error = TransactionError::InstructionError(0, InstructionError::InvalidInstructionData);
let instruction = &tx.message().instructions[0];
let error = TransactionError::InstructionError(0, InstructionError::InvalidInstructionData);
// Compute budget instruction must be in 1st or 2nd instruction (avoid nonce marker)
for instruction in tx.message().instructions.iter().take(2) {
if check_id(instruction.program_id(&tx.message().account_keys)) {
let ComputeBudgetInstruction::RequestUnits(units) =
try_from_slice_unchecked::<ComputeBudgetInstruction>(&instruction.data)
Expand Down

0 comments on commit 795b81f

Please sign in to comment.