Generate the old message for batch signature only if its necessare
@@ -222,7 +222,6 @@ async fn verify_eth_signature_txs_batch(
let start = Instant::now();
// Cache for verified senders.
let mut signers = HashSet::with_capacity(senders.len());
- let old_message = EthBatchSignData::get_old_ethereum_batch_message(txs.iter().map(|tx| &tx.tx));
// For every sender check whether there exists at least one signature that matches it.
for sender in senders {
if signers.contains(sender) {
@@ -243,6 +242,8 @@ async fn verify_eth_signature_txs_batch(
)
.await;
if !signature_correct {
+ let old_message =
+ EthBatchSignData::get_old_ethereum_batch_message(txs.iter().map(|tx| &tx.tx));
signature_correct = verify_ethereum_signature(
signature,
old_message.as_slice(),
