@@ -61,7 +61,6 @@ pub struct Downstream {
61
61
extranonce2_len : usize ,
62
62
pub ( super ) difficulty_mgmt : DownstreamDifficultyConfig ,
63
63
pub ( super ) upstream_difficulty_config : Arc < Mutex < UpstreamDifficultyConfig > > ,
64
- last_job_id : String , // we usually receive a String on SV1 messages, no need to cast to u32
65
64
}
66
65
67
66
impl Downstream {
@@ -92,7 +91,6 @@ impl Downstream {
92
91
extranonce2_len,
93
92
difficulty_mgmt,
94
93
upstream_difficulty_config,
95
- last_job_id,
96
94
}
97
95
}
98
96
/// Instantiate a new `Downstream`.
@@ -128,7 +126,6 @@ impl Downstream {
128
126
extranonce2_len,
129
127
difficulty_mgmt : difficulty_config,
130
128
upstream_difficulty_config,
131
- last_job_id : "" . to_string ( ) ,
132
129
} ) ) ;
133
130
let self_ = downstream. clone ( ) ;
134
131
@@ -287,10 +284,6 @@ impl Downstream {
287
284
288
285
let sv1_mining_notify_msg = last_notify. clone ( ) . unwrap ( ) ;
289
286
290
- self_
291
- . safe_lock ( |s| s. last_job_id = sv1_mining_notify_msg. clone ( ) . job_id )
292
- . unwrap ( ) ;
293
-
294
287
let message: json_rpc:: Message = sv1_mining_notify_msg. into ( ) ;
295
288
handle_result ! (
296
289
tx_status_notify,
@@ -314,8 +307,6 @@ impl Downstream {
314
307
let sv1_mining_notify_msg = handle_result!( tx_status_notify, res) ;
315
308
let message: json_rpc:: Message = sv1_mining_notify_msg. clone( ) . into( ) ;
316
309
317
- self_. safe_lock( |s| s. last_job_id = sv1_mining_notify_msg. job_id) . unwrap( ) ;
318
-
319
310
handle_result!( tx_status_notify, Downstream :: send_message_downstream( downstream. clone( ) , message) . await ) ;
320
311
} ,
321
312
_ = rx_shutdown. recv( ) . fuse( ) => {
@@ -538,23 +529,19 @@ impl IsServer<'static> for Downstream {
538
529
539
530
// TODO: Check if receiving valid shares by adding diff field to Downstream
540
531
541
- if request. job_id == self . last_job_id {
542
- let to_send = SubmitShareWithChannelId {
543
- channel_id : self . connection_id ,
544
- share : request. clone ( ) ,
545
- extranonce : self . extranonce1 . clone ( ) ,
546
- extranonce2_len : self . extranonce2_len ,
547
- version_rolling_mask : self . version_rolling_mask . clone ( ) ,
548
- } ;
549
-
550
- self . tx_sv1_bridge
551
- . try_send ( DownstreamMessages :: SubmitShares ( to_send) )
552
- . unwrap ( ) ;
553
-
554
- true
555
- } else {
556
- false
557
- }
532
+ let to_send = SubmitShareWithChannelId {
533
+ channel_id : self . connection_id ,
534
+ share : request. clone ( ) ,
535
+ extranonce : self . extranonce1 . clone ( ) ,
536
+ extranonce2_len : self . extranonce2_len ,
537
+ version_rolling_mask : self . version_rolling_mask . clone ( ) ,
538
+ } ;
539
+
540
+ self . tx_sv1_bridge
541
+ . try_send ( DownstreamMessages :: SubmitShares ( to_send) )
542
+ . unwrap ( ) ;
543
+
544
+ true
558
545
}
559
546
560
547
/// Indicates to the server that the client supports the mining.set_extranonce method.
0 commit comments