Backports for beta (#1888)
* Sync to peers with confirmed fork block only (#1863) * Fixing gas conversion * Validating u256->usize conversion * Update cache usage on commiting block info (#1871) * Use UntrustedRlp for block verification (#1872) * take snapshot at specified block and slightly better informants (#1873) * prettier informant for snapshot creation * allow taking snapshot at a given block * minor tweaks * elaborate on cli * Send new block hashes to all peers (#1875) * Reduce max open files (#1876) * ws-rs update * Fixing test * Fixing miner deadlock (#1885)
This commit is contained in:
@@ -18,6 +18,8 @@
|
||||
|
||||
use std::fmt;
|
||||
|
||||
use ids::BlockID;
|
||||
|
||||
use util::H256;
|
||||
use util::trie::TrieError;
|
||||
use util::rlp::DecoderError;
|
||||
@@ -26,9 +28,13 @@ use util::rlp::DecoderError;
|
||||
#[derive(Debug)]
|
||||
pub enum Error {
|
||||
/// Invalid starting block for snapshot.
|
||||
InvalidStartingBlock(H256),
|
||||
InvalidStartingBlock(BlockID),
|
||||
/// Block not found.
|
||||
BlockNotFound(H256),
|
||||
/// Incomplete chain.
|
||||
IncompleteChain,
|
||||
/// Old starting block in a pruned database.
|
||||
OldBlockPrunedDB,
|
||||
/// Trie error.
|
||||
Trie(TrieError),
|
||||
/// Decoder error.
|
||||
@@ -40,8 +46,11 @@ pub enum Error {
|
||||
impl fmt::Display for Error {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
match *self {
|
||||
Error::InvalidStartingBlock(ref hash) => write!(f, "Invalid starting block hash: {}", hash),
|
||||
Error::InvalidStartingBlock(ref id) => write!(f, "Invalid starting block: {:?}", id),
|
||||
Error::BlockNotFound(ref hash) => write!(f, "Block not found in chain: {}", hash),
|
||||
Error::IncompleteChain => write!(f, "Cannot create snapshot due to incomplete chain."),
|
||||
Error::OldBlockPrunedDB => write!(f, "Attempted to create a snapshot at an old block while using \
|
||||
a pruned database. Please re-run with the --pruning archive flag."),
|
||||
Error::Io(ref err) => err.fmt(f),
|
||||
Error::Decoder(ref err) => err.fmt(f),
|
||||
Error::Trie(ref err) => err.fmt(f),
|
||||
|
||||
Reference in New Issue
Block a user