@@ -40,7 +40,6 @@ use crate::prelude::*;
40
40
use crate :: io;
41
41
use core:: fmt;
42
42
43
- use crate :: network;
44
43
use crate :: consensus:: encode;
45
44
46
45
/// A trait which allows numbers to act as fixed-size bit arrays
@@ -71,8 +70,6 @@ pub trait BitArray {
71
70
pub enum Error {
72
71
/// Encoding error
73
72
Encode ( encode:: Error ) ,
74
- /// Network error
75
- Network ( network:: Error ) ,
76
73
/// The header hash is not below the target
77
74
BlockBadProofOfWork ,
78
75
/// The `target` field of a block header did not match the expected difficulty
@@ -83,7 +80,6 @@ impl fmt::Display for Error {
83
80
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
84
81
match * self {
85
82
Error :: Encode ( ref e) => write_err ! ( f, "encoding error" ; e) ,
86
- Error :: Network ( ref e) => write_err ! ( f, "network error" ; e) ,
87
83
Error :: BlockBadProofOfWork => f. write_str ( "block target correct but not attained" ) ,
88
84
Error :: BlockBadTarget => f. write_str ( "block target incorrect" ) ,
89
85
}
@@ -98,9 +94,7 @@ impl std::error::Error for Error {
98
94
99
95
match self {
100
96
Encode ( e) => Some ( e) ,
101
- Network ( e) => Some ( e) ,
102
- BlockBadProofOfWork
103
- | BlockBadTarget => None
97
+ BlockBadProofOfWork | BlockBadTarget => None
104
98
}
105
99
}
106
100
}
@@ -112,13 +106,6 @@ impl From<encode::Error> for Error {
112
106
}
113
107
}
114
108
115
- #[ doc( hidden) ]
116
- impl From < network:: Error > for Error {
117
- fn from ( e : network:: Error ) -> Error {
118
- Error :: Network ( e)
119
- }
120
- }
121
-
122
109
// core2 doesn't have read_to_end
123
110
pub ( crate ) fn read_to_end < D : io:: Read > ( mut d : D ) -> Result < Vec < u8 > , io:: Error > {
124
111
let mut result = vec ! [ ] ;
0 commit comments