We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b8d7458 commit dc8afd0Copy full SHA for dc8afd0
1 file changed
store/postgres/src/chain_store.rs
@@ -2127,6 +2127,12 @@ impl ChainHeadPtrCache {
2127
let ttl = self.current_ttl();
2128
*self.entry.write() = Some((new_value, now + ttl));
2129
}
2130
+
2131
+ /// Clear the cached value. Used in tests when chain is reset.
2132
+ #[cfg(debug_assertions)]
2133
+ fn clear(&self) {
2134
+ *self.entry.write() = None;
2135
+ }
2136
2137
2138
pub struct ChainStore {
@@ -2360,6 +2366,7 @@ impl ChainStore {
2360
2366
2361
2367
self.storage.remove_chain(&mut conn, &self.chain).await;
2362
2368
self.recent_blocks_cache.clear();
2369
+ self.chain_head_ptr_cache.clear();
2363
2370
2364
2371
for block in chain {
2365
2372
self.upsert_block(block).await.expect("can upsert block");
0 commit comments