mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
perf: query accounts with &Address to avoid copying address (#13554)
This commit is contained in:
@ -535,7 +535,7 @@ where
|
||||
Err(err) => return Err(Box::new((addresses.collect(), err))),
|
||||
};
|
||||
for addr in addresses {
|
||||
if let Ok(maybe_acc) = state.basic_account(addr) {
|
||||
if let Ok(maybe_acc) = state.basic_account(&addr) {
|
||||
let acc = maybe_acc
|
||||
.map(|acc| ChangedAccount { address: addr, nonce: acc.nonce, balance: acc.balance })
|
||||
.unwrap_or_else(|| ChangedAccount::empty(addr));
|
||||
|
||||
@ -367,7 +367,7 @@ where
|
||||
let state = maybe_state.as_deref().expect("provider is set");
|
||||
|
||||
// Use provider to get account info
|
||||
let account = match state.basic_account(transaction.sender()) {
|
||||
let account = match state.basic_account(transaction.sender_ref()) {
|
||||
Ok(account) => account.unwrap_or_default(),
|
||||
Err(err) => {
|
||||
return TransactionValidationOutcome::Error(*transaction.hash(), Box::new(err))
|
||||
|
||||
Reference in New Issue
Block a user