diff --git a/ethcore/light/src/client/mod.rs b/ethcore/light/src/client/mod.rs index a41aa551d..c13d6ba91 100644 --- a/ethcore/light/src/client/mod.rs +++ b/ethcore/light/src/client/mod.rs @@ -330,8 +330,14 @@ impl Client { The node may not be able to synchronize further.", e); } + let epoch_proof = self.engine.is_epoch_end( + &verified_header, + &|h| self.chain.block_header(BlockId::Hash(h)).map(|hdr| hdr.decode()), + &|h| self.chain.pending_transition(h), + ); + let mut tx = self.db.transaction(); - let pending = match self.chain.insert(&mut tx, verified_header, None) { + let pending = match self.chain.insert(&mut tx, verified_header, epoch_proof) { Ok(pending) => { good.push(hash); self.report.write().blocks_imported += 1; @@ -344,8 +350,6 @@ impl Client { } }; - // TODO: check epoch end and verify under epoch verifier. - self.db.write_buffered(tx); self.chain.apply_pending(pending); }