From 29b3265dc7c9dfa246f6e8afb99f2bd7feee59bd Mon Sep 17 00:00:00 2001 From: Trent Nelson Date: Tue, 4 Aug 2020 21:23:35 -0600 Subject: [PATCH] Sanitize transactions during RPC preflight test --- runtime/src/bank.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index a88557abaa..eb19b7c65a 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -47,6 +47,7 @@ use solana_sdk::{ native_loader, nonce, program_utils::limited_deserialize, pubkey::Pubkey, + sanitize::Sanitize, signature::{Keypair, Signature}, slot_hashes::SlotHashes, slot_history::SlotHistory, @@ -1346,7 +1347,11 @@ impl Bank { &'a self, txs: &'b [Transaction], ) -> TransactionBatch<'a, 'b> { - let mut batch = TransactionBatch::new(vec![Ok(()); txs.len()], &self, txs, None); + let lock_results: Vec<_> = txs + .iter() + .map(|tx| tx.sanitize().map_err(|e| e.into())) + .collect(); + let mut batch = TransactionBatch::new(lock_results, &self, txs, None); batch.needs_unlock = false; batch }