func (m *Miner) deleteRequest(id uint64) {
	m.reqMtx.Lock()
	delete(m.req, id)
	m.reqMtx.Unlock()
}
deleteRequest removes the provided request id from the id cache.
package main
import (
	"bufio"
	"context"
	"encoding/json"
	"errors"
	"io"
	"math/big"
	"net"
	"sync"
	"sync/atomic"
	"time"
	"github.com/decred/dcrpool/pool"
)
type Work struct {
	jobID  string
	header []byte
	target *big.Rat
}
type Miner struct {
	id uint64  
	conn            net.Conn
	core            *CPUMiner
	encoder         *json.Encoder
	reader          *bufio.Reader
	work            *Work
	workMtx         sync.RWMutex
	config          *config
	req             map[uint64]string
	reqMtx          sync.RWMutex
	chainCh         chan struct{}
	readCh          chan []byte
	authorized      bool
	subscribed      bool
	connected       bool
	connectedMtx    sync.RWMutex
	started         int64
	cancel          context.CancelFunc
	extraNonce1E    string
	extraNonce2Size uint64
	notifyID        string
	wg              sync.WaitGroup
}
func (m *Miner) recordRequest(id uint64, method string) {
	m.reqMtx.Lock()
	m.req[id] = method
	m.reqMtx.Unlock()
}
func (m *Miner) fetchRequest(id uint64) string {
	m.reqMtx.RLock()
	method := m.req[id]
	m.reqMtx.RUnlock()
	return method
}