From ffa4901f7b91ef0beca0365e8fdc29e295a7430b Mon Sep 17 00:00:00 2001 From: Michael Sproul Date: Mon, 28 Nov 2022 10:48:50 +1100 Subject: [PATCH] Fix store.block_exists and HTTP header API --- beacon_node/store/src/hot_cold_store.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/beacon_node/store/src/hot_cold_store.rs b/beacon_node/store/src/hot_cold_store.rs index c7def479ca..8a7cd0562b 100644 --- a/beacon_node/store/src/hot_cold_store.rs +++ b/beacon_node/store/src/hot_cold_store.rs @@ -601,10 +601,14 @@ impl, Cold: ItemStore> HotColdDB .map(|payload| payload.is_some()) } - /// Determine whether a block exists in the database. + /// Determine whether a block exists in the database (hot *or* cold). pub fn block_exists(&self, block_root: &Hash256) -> Result { - self.hot_db - .key_exists(DBColumn::BeaconBlock.into(), block_root.as_bytes()) + Ok(self + .hot_db + .key_exists(DBColumn::BeaconBlock.into(), block_root.as_bytes())? + || self + .cold_db + .key_exists(DBColumn::BeaconBlock.into(), block_root.as_bytes())?) } /// Delete a block from the store and the block cache.