Cleanup stratum a bit (#11161)
* Cleanup stratum a bit Salvage some code from https://github.com/paritytech/parity-ethereum/pull/10884 + some cleanup and typos. * HashSet::new does not allocate before first insert * Remove unused method push_work()
This commit is contained in:
@@ -225,8 +225,6 @@ impl NotifyWork for Stratum {
|
||||
|
||||
self.service.push_work_all(
|
||||
self.dispatcher.payload(pow_hash, difficulty, number)
|
||||
).unwrap_or_else(
|
||||
|e| warn!(target: "stratum", "Error while pushing work: {:?}", e)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -239,16 +237,13 @@ impl Stratum {
|
||||
|
||||
let dispatcher = Arc::new(StratumJobDispatcher::new(miner, client));
|
||||
|
||||
let stratum_svc = StratumService::start(
|
||||
let service = StratumService::start(
|
||||
&SocketAddr::new(options.listen_addr.parse::<IpAddr>()?, options.port),
|
||||
dispatcher.clone(),
|
||||
options.secret.clone(),
|
||||
)?;
|
||||
|
||||
Ok(Stratum {
|
||||
dispatcher: dispatcher,
|
||||
service: stratum_svc,
|
||||
})
|
||||
Ok(Stratum { dispatcher, service })
|
||||
}
|
||||
|
||||
/// Start STRATUM job dispatcher and register it in the miner
|
||||
|
||||
Reference in New Issue
Block a user