verbose difficulty error

This commit is contained in:
NikVolf 2016-12-14 15:43:10 +01:00
parent 124509b0ce
commit 57858a059a
2 changed files with 3 additions and 3 deletions

View File

@ -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 })
}
}
}

View File

@ -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