Merge pull request #332 from ethcore/verbose-difficulty
Make difficulty error less cryptic
This commit is contained in:
commit
af23fefa17
|
@ -84,7 +84,7 @@ impl<'a> HeaderRule for HeaderWork<'a> {
|
||||||
if work == self.header.raw.bits {
|
if work == self.header.raw.bits {
|
||||||
Ok(())
|
Ok(())
|
||||||
} else {
|
} else {
|
||||||
Err(Error::Difficulty)
|
Err(Error::Difficulty { expected: work, actual: self.header.raw.bits })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use primitives::hash::H256;
|
use primitives::{H256, Compact};
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
/// All possible verification errors
|
/// All possible verification errors
|
||||||
|
@ -20,7 +20,7 @@ pub enum Error {
|
||||||
/// One of the transactions is invalid (corresponding index and specific transaction error)
|
/// One of the transactions is invalid (corresponding index and specific transaction error)
|
||||||
Transaction(usize, TransactionError),
|
Transaction(usize, TransactionError),
|
||||||
/// nBits do not match difficulty rules
|
/// nBits do not match difficulty rules
|
||||||
Difficulty,
|
Difficulty { expected: Compact, actual: Compact },
|
||||||
/// Invalid merkle root
|
/// Invalid merkle root
|
||||||
MerkleRoot,
|
MerkleRoot,
|
||||||
/// Coinbase spends too much
|
/// Coinbase spends too much
|
||||||
|
|
Loading…
Reference in New Issue