Add check for missing signature with fee'ed transaction

And update fetch-perf-libs version
This commit is contained in:
Stephen Akridge 2018-11-15 12:58:40 -08:00 committed by Michael Vines
parent 7dd198a99e
commit 3543a9a49f
2 changed files with 7 additions and 2 deletions

View File

@ -16,7 +16,7 @@ mkdir -p target/perf-libs
cd target/perf-libs
(
set -x
curl https://solana-perf.s3.amazonaws.com/v0.11.0/x86_64-unknown-linux-gnu/solana-perf.tgz | tar zxvf -
curl https://solana-perf.s3.amazonaws.com/v0.11.1/x86_64-unknown-linux-gnu/solana-perf.tgz | tar zxvf -
)
if [[ -r solana-perf-CUDA_HOME.txt ]]; then

View File

@ -104,6 +104,9 @@ pub enum BankError {
/// Loader call chain too deep
CallChainTooDeep,
/// Transaction has a fee but has no signature present
MissingSignatureForFee,
}
pub type Result<T> = result::Result<T, BankError>;
@ -637,7 +640,9 @@ impl Bank {
error_counters: &mut ErrorCounters,
) -> Result<Vec<Account>> {
// Copy all the accounts
if accounts.load(&tx.account_keys[0]).is_none() {
if tx.signatures.is_empty() && tx.fee != 0 {
Err(BankError::MissingSignatureForFee)
} else if accounts.load(&tx.account_keys[0]).is_none() {
error_counters.account_not_found += 1;
Err(BankError::AccountNotFound)
} else if accounts.load(&tx.account_keys[0]).unwrap().tokens < tx.fee {