From 2ef24b3b65bd6335ff735dc5dbe820ce7e94bfc5 Mon Sep 17 00:00:00 2001 From: Georgios Konstantopoulos Date: Sat, 4 Feb 2023 19:12:21 -0800 Subject: [PATCH] chore(stages/total-difficulty): make header cursor ro (#1174) --- crates/stages/src/stages/total_difficulty.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/stages/src/stages/total_difficulty.rs b/crates/stages/src/stages/total_difficulty.rs index 9edf5e1b93..696a9846f0 100644 --- a/crates/stages/src/stages/total_difficulty.rs +++ b/crates/stages/src/stages/total_difficulty.rs @@ -6,7 +6,7 @@ use reth_db::{ cursor::{DbCursorRO, DbCursorRW}, database::Database, tables, - transaction::DbTxMut, + transaction::{DbTx, DbTxMut}, }; use reth_primitives::U256; use tracing::*; @@ -50,7 +50,7 @@ impl Stage for TotalDifficultyStage { // Acquire cursor over total difficulty and headers tables let mut cursor_td = tx.cursor_write::()?; - let mut cursor_headers = tx.cursor_write::()?; + let mut cursor_headers = tx.cursor_read::()?; // Get latest total difficulty let last_header_key = tx.get_block_numhash(input.stage_progress.unwrap_or_default())?;