Skip to content

Commit

Permalink
debug: drop tx_ref asap
Browse files Browse the repository at this point in the history
  • Loading branch information
kien-rise committed Aug 14, 2024
1 parent ef0753b commit 3c42de2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/storage/on_disk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ impl OnDiskStorage {
let bytes: Option<Vec<u8>> = tx_ref
.value()
.get(self.table_accounts.dbi(), address.as_ref())?;
drop(tx_ref);
let account: Option<EvmAccount> = match bytes {
Some(bytes) => Some(
bincode::deserialize(bytes.as_slice())
Expand Down Expand Up @@ -93,6 +94,7 @@ impl Storage for OnDiskStorage {
let bytes: Option<Vec<u8>> = tx_ref
.value()
.get(self.table_bytecodes.dbi(), code_hash.as_ref())?;
drop(tx_ref);
let code: Option<EvmCode> = match bytes {
Some(bytes) => Some(
bincode::deserialize(bytes.as_slice())
Expand Down Expand Up @@ -135,6 +137,7 @@ impl Storage for OnDiskStorage {
let bytes: Option<[u8; 32]> = tx_ref
.value()
.get(self.table_block_hashes.dbi(), B64::from(*number).as_ref())?;
drop(tx_ref);
let block_hash = match bytes {
Some(bytes) => B256::from(bytes),
None => keccak256(number.to_string().as_bytes()),
Expand Down

0 comments on commit 3c42de2

Please sign in to comment.