Add error messages to ledger verify

This commit is contained in:
Stephen Akridge
2018-07-23 23:13:24 +00:00
committed by sakridge
parent 8f046cb1f8
commit 6bd18e18ea
3 changed files with 31 additions and 3 deletions

View File

@@ -22,7 +22,17 @@ impl Block for [Entry] {
fn verify(&self, start_hash: &Hash) -> bool {
let genesis = [Entry::new_tick(0, start_hash)];
let entry_pairs = genesis.par_iter().chain(self).zip(self);
entry_pairs.all(|(x0, x1)| x1.verify(&x0.id))
entry_pairs.all(|(x0, x1)| {
let r = x1.verify(&x0.id);
if !r {
error!(
"entry invalid!: {:?} num txs: {}",
x1.id,
x1.transactions.len()
);
}
r
})
}
fn to_blobs(&self, blob_recycler: &packet::BlobRecycler, q: &mut VecDeque<SharedBlob>) {