Skip to content

Commit

Permalink
getRecentPrioritizationFees only needs writable accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
mvines committed Jun 7, 2024
1 parent ec309db commit e1da492
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/priority_fee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ fn get_recent_priority_fees_for_instructions(
instruction
.accounts
.iter()
.map(|account_meta| account_meta.pubkey)
.filter_map(|account_meta| account_meta.is_writable.then_some(account_meta.pubkey))
.collect::<Vec<_>>()
})
.collect();
account_keys.sort();
account_keys.dedup();

let mut prioritization_fees: Vec<_> = rpc_client
let prioritization_fees: Vec<_> = rpc_client
.get_recent_prioritization_fees(&account_keys)
.map(|response| {
response
Expand All @@ -95,8 +95,6 @@ fn get_recent_priority_fees_for_instructions(
})
.map_err(|err| format!("Failed to invoke RPC method getRecentPrioritizationFees: {err}"))?;

prioritization_fees.sort();

Ok(prioritization_fees)
}

Expand Down

0 comments on commit e1da492

Please sign in to comment.