This commit is contained in:
Michael Vines
2020-08-01 08:44:32 -07:00
committed by mergify[bot]
parent 01262cda3f
commit eefcf484cb
9 changed files with 20 additions and 46 deletions

View File

@@ -1519,13 +1519,9 @@ impl AccountsDB {
hashes = new_hashes.chunks(fanout).map(|x| x.to_vec()).collect();
}
let mut hasher = Hasher::default();
hashes
.into_iter()
.flatten()
.map(|hash| hash)
.for_each(|hash| {
hasher.hash(hash.as_ref());
});
hashes.into_iter().flatten().for_each(|hash| {
hasher.hash(hash.as_ref());
});
hasher.result()
}

View File

@@ -198,10 +198,7 @@ pub enum HashAgeKind {
impl HashAgeKind {
pub fn is_durable_nonce(&self) -> bool {
match self {
HashAgeKind::DurableNonce(_, _) => true,
_ => false,
}
matches!(self, HashAgeKind::DurableNonce(_, _))
}
}

View File

@@ -23,10 +23,8 @@ pub fn transaction_uses_durable_nonce(tx: &Transaction) -> Option<&CompiledInstr
Some(program_id) => system_program::check_id(&program_id),
_ => false,
}
} && match limited_deserialize(&maybe_ix.data) {
Ok(SystemInstruction::AdvanceNonceAccount) => true,
_ => false,
})
} && matches!(limited_deserialize(&maybe_ix.data), Ok(SystemInstruction::AdvanceNonceAccount))
)
}
pub fn get_nonce_pubkey_from_instruction<'a>(