pub fn add_shares(&mut self, size: u32, accepted: u64, rejected: u64, stale: u64) {
        if self.worker_shares.shares.contains_key(&size) {
            match self.worker_shares.shares.get_mut(&size) {
                Some(mut shares) => {
                    shares.accepted += accepted;
                    shares.rejected += rejected;
                    shares.stale += stale;
                },
                None => {
                    // This cant happen
                }
            }
        } else {
            let mut shares: Shares = Shares::new(size);
            shares.accepted = accepted;
            shares.rejected = rejected;
            shares.stale = stale;
            self.worker_shares.shares.insert(size, shares);
        }
    }
/// Add a share to the worker_shares
Add a share to the worker_shares
Add a share to the worker_shares
pub fn add_shares(&mut self, size: u32, accepted: u64, rejected: u64, stale: u64) {
        if self.worker_shares.shares.contains_key(&size) {
            match self.worker_shares.shares.get_mut(&size) {
                Some(mut shares) => {
                    shares.accepted += accepted;
                    shares.rejected += rejected;
                    shares.stale += stale;
                },
                None => {
                    // This cant happen
                }
            }
        } else {
            let mut shares: Shares = Shares::new(size);
            shares.accepted = accepted;
            shares.rejected = rejected;
            shares.stale = stale;
            self.worker_shares.shares.insert(size, shares);
        }
    }
pub fn add_shares ( & mut self , size : u32 , accepted : u64 , rejected : u64 , stale : u64 ) { if self . worker_shares . shares . contains_key ( & size ) { match self . worker_shares . shares . get_mut ( & size ) { Some ( mut shares ) => { shares . accepted += accepted ; shares . rejected += rejected ; shares . stale += stale ; } , None => { // This cant happen } } } else { let mut shares : Shares = Shares :: new ( size ) ; shares . accepted = accepted ; shares . rejected = rejected ; shares . stale = stale ; self . worker_shares . shares . insert ( size , shares ) ; } }
Add a share to the worker_shares
Add a share to the worker_shares
&mut self
size
u32
accepted
u64
rejected
u64
stale
u64