Rustify core/src/core (#1122)

Small refactoring of one folder, if it makes sense I could extend the scope.
* Remove some cloning (real and just verbosity in the code)
* Naming conventions like to/into*
* Some Clippy's suggestions

I found that we don't use field init shorthand syntax, so I didn't touch this part, was it discussed before?
This commit is contained in:
hashmap
2018-06-01 21:41:26 +02:00
committed by Yeastplume
parent 7812a02233
commit 2fa32d15ce
27 changed files with 215 additions and 263 deletions
+1 -2
View File
@@ -446,7 +446,6 @@ impl StratumServer {
// Reconstruct the block header with this nonce and pow added
b = self.current_block.clone();
b.header.nonce = submit_params.nonce;
b.header.pow.proof_size = submit_params.pow.len();
b.header.pow.nonces = submit_params.pow;
let res = self.chain.process_block(b.clone(), chain::Options::MINE);
if let Err(e) = res {
@@ -644,7 +643,7 @@ impl StratumServer {
self.current_block = new_block;
self.current_difficulty = (self.current_block.header.total_difficulty.clone()
- head.total_difficulty.clone())
.into_num();
.to_num();
self.current_key_id = block_fees.key_id();
current_hash = latest_hash;
// set a new deadline for rebuilding with fresh transactions