verbose difficulty error
This commit is contained in:
parent
124509b0ce
commit
57858a059a
|
@ -84,7 +84,7 @@ impl<'a> HeaderRule for HeaderWork<'a> {
|
|||
if work == self.header.raw.bits {
|
||||
Ok(())
|
||||
} 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)]
|
||||
/// All possible verification errors
|
||||
|
@ -20,7 +20,7 @@ pub enum Error {
|
|||
/// One of the transactions is invalid (corresponding index and specific transaction error)
|
||||
Transaction(usize, TransactionError),
|
||||
/// nBits do not match difficulty rules
|
||||
Difficulty,
|
||||
Difficulty { expected: Compact, actual: Compact },
|
||||
/// Invalid merkle root
|
||||
MerkleRoot,
|
||||
/// Coinbase spends too much
|
||||
|
|
Loading…
Reference in New Issue