This commit is contained in:
Adrian Brink 2017-04-06 20:58:57 +02:00
parent 23c76caafa
commit 3632a98062

View File

@ -366,9 +366,8 @@ impl HeaderChain {
pub fn block_header(&self, id: BlockId) -> Option<encoded::Header> { pub fn block_header(&self, id: BlockId) -> Option<encoded::Header> {
let load_from_db = |hash: H256| { let load_from_db = |hash: H256| {
let mut cache = self.cache.lock(); let mut cache = self.cache.lock();
let header = cache.block_header(&hash);
match header { match cache.block_header(&hash) {
Some(header) => Some(header), Some(header) => Some(header),
None => { None => {
match self.db.get(self.col, &hash) { match self.db.get(self.col, &hash) {