From 48aa410f8ad1c57cc08e4aab66bf11eb9700c681 Mon Sep 17 00:00:00 2001 From: Advaita Saha Date: Thu, 19 Dec 2024 01:13:12 +0530 Subject: [PATCH] reduce blockHash call (#2954) --- .gitignore | 3 +++ nimbus/core/chain/forked_chain.nim | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 59a1b56a7..edbbeac7d 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,6 @@ nimble.paths # nimbus-build-system files nimbus-build-system.paths + +# vscode generated files for path mapping into vendor +.vscode \ No newline at end of file diff --git a/nimbus/core/chain/forked_chain.nim b/nimbus/core/chain/forked_chain.nim index 7f4aba800..184cf99c2 100644 --- a/nimbus/core/chain/forked_chain.nim +++ b/nimbus/core/chain/forked_chain.nim @@ -153,8 +153,9 @@ proc validateBlock(c: ForkedChainRef, if updateCursor: c.updateCursor(blk, move(res.value)) + let blkHash = blk.header.blockHash for i, tx in blk.transactions: - c.txRecords[rlpHash(tx)] = (blk.header.blockHash, uint64(i)) + c.txRecords[rlpHash(tx)] = (blkHash, uint64(i)) ok()