@@ -131,8 +131,8 @@ impl Engine for Ethash {
131
131
} ;
132
132
header. set_difficulty ( difficulty) ;
133
133
header. set_gas_limit ( gas_limit) ;
134
- if header. number ( ) . clone ( ) >= self . ethash_params . dao_hardfork_transition &&
135
- header. number ( ) . clone ( ) <= self . ethash_params . dao_hardfork_transition + 9 {
134
+ if header. number ( ) >= self . ethash_params . dao_hardfork_transition &&
135
+ header. number ( ) <= self . ethash_params . dao_hardfork_transition + 9 {
136
136
header. set_extra_data ( b"dao-hard-fork" [ ..] . to_owned ( ) ) ;
137
137
}
138
138
header. note_dirty ( ) ;
@@ -183,7 +183,7 @@ impl Engine for Ethash {
183
183
184
184
// TODO: consider removing these lines.
185
185
let min_difficulty = self . ethash_params . minimum_difficulty ;
186
- if header. difficulty ( ) . clone ( ) < min_difficulty {
186
+ if header. difficulty ( ) < & min_difficulty {
187
187
return Err ( From :: from ( BlockError :: DifficultyOutOfBounds ( OutOfBounds { min : Some ( min_difficulty) , max : None , found : header. difficulty ( ) . clone ( ) } ) ) )
188
188
}
189
189
@@ -192,7 +192,7 @@ impl Engine for Ethash {
192
192
header. nonce ( ) . low_u64 ( ) ,
193
193
& Ethash :: to_ethash ( header. mix_hash ( ) )
194
194
) ) ) ;
195
- if difficulty < header. difficulty ( ) . clone ( ) {
195
+ if & difficulty < header. difficulty ( ) {
196
196
return Err ( From :: from ( BlockError :: InvalidProofOfWork ( OutOfBounds { min : Some ( header. difficulty ( ) . clone ( ) ) , max : None , found : difficulty } ) ) ) ;
197
197
}
198
198
@@ -202,7 +202,7 @@ impl Engine for Ethash {
202
202
return Err ( From :: from ( BlockError :: ExtraDataOutOfBounds ( OutOfBounds { min : None , max : None , found : 0 } ) ) ) ;
203
203
}
204
204
205
- if header. gas_limit ( ) . clone ( ) > 0x7fffffffffffffffu64 . into ( ) {
205
+ if header. gas_limit ( ) > & 0x7fffffffffffffffu64 . into ( ) {
206
206
return Err ( From :: from ( BlockError :: InvalidGasLimit ( OutOfBounds { min : None , max : Some ( 0x7fffffffffffffffu64 . into ( ) ) , found : header. gas_limit ( ) . clone ( ) } ) ) ) ;
207
207
}
208
208
@@ -218,10 +218,10 @@ impl Engine for Ethash {
218
218
let result = self . pow . compute_light ( header. number ( ) as u64 , & Ethash :: to_ethash ( header. bare_hash ( ) ) , header. nonce ( ) . low_u64 ( ) ) ;
219
219
let mix = Ethash :: from_ethash ( result. mix_hash ) ;
220
220
let difficulty = Ethash :: boundary_to_difficulty ( & Ethash :: from_ethash ( result. value ) ) ;
221
- if mix != header. mix_hash ( ) . clone ( ) {
221
+ if mix != header. mix_hash ( ) {
222
222
return Err ( From :: from ( BlockError :: MismatchedH256SealElement ( Mismatch { expected : mix, found : header. mix_hash ( ) } ) ) ) ;
223
223
}
224
- if difficulty < header. difficulty ( ) . clone ( ) {
224
+ if & difficulty < header. difficulty ( ) {
225
225
return Err ( From :: from ( BlockError :: InvalidProofOfWork ( OutOfBounds { min : Some ( header. difficulty ( ) . clone ( ) ) , max : None , found : difficulty } ) ) ) ;
226
226
}
227
227
Ok ( ( ) )
@@ -235,13 +235,13 @@ impl Engine for Ethash {
235
235
236
236
// Check difficulty is correct given the two timestamps.
237
237
let expected_difficulty = self . calculate_difficulty ( header, parent) ;
238
- if header. difficulty ( ) . clone ( ) != expected_difficulty {
238
+ if header. difficulty ( ) != & expected_difficulty {
239
239
return Err ( From :: from ( BlockError :: InvalidDifficulty ( Mismatch { expected : expected_difficulty, found : header. difficulty ( ) . clone ( ) } ) ) )
240
240
}
241
241
let gas_limit_divisor = self . ethash_params . gas_limit_bound_divisor ;
242
242
let min_gas = parent. gas_limit ( ) . clone ( ) - parent. gas_limit ( ) . clone ( ) / gas_limit_divisor;
243
243
let max_gas = parent. gas_limit ( ) . clone ( ) + parent. gas_limit ( ) . clone ( ) / gas_limit_divisor;
244
- if header. gas_limit ( ) . clone ( ) <= min_gas || header. gas_limit ( ) . clone ( ) >= max_gas {
244
+ if header. gas_limit ( ) <= & min_gas || header. gas_limit ( ) >= & max_gas {
245
245
return Err ( From :: from ( BlockError :: InvalidGasLimit ( OutOfBounds { min : Some ( min_gas) , max : Some ( max_gas) , found : header. gas_limit ( ) . clone ( ) } ) ) ) ;
246
246
}
247
247
Ok ( ( ) )
0 commit comments