This does the minimum work necessary to refactor the CPU miner code into its own internal package. The idea is that separating this code into its own package will improve its testability and ultimately be useful to other parts of the codebase such as the various tests which currently effectively have their own stripped-down versions of this code. The API will certainly need some additional cleanup and changes to make it more usable outside of the specific circumstances it was originally designed to support (namely the generate RPC), however it is better to do that in future commits in order to keep the changeset as small as possible during this refactor. Overview of the major changes: - Create the new package - Move internal/mining/cpuminer.go -> internal/mining/cpuminer/cpuminer.go - Update mining logging to use the new cpuminer package logger - Rename CPUMinerConfig to Config (so it's now cpuminer.Config) - Rename NewCPUMiner to New (so it's now cpuminer.New) - Add exported BestSnapshot method to mining.BlkTmplGenerator - Add exported TxSource method to mining.BlkTmplGenerator - Update all references to the cpuminer to use the package - Add a skeleton README.md - Add a skeleton doc.go
12 lines
301 B
Go
12 lines
301 B
Go
// Copyright (c) 2020 The Decred developers
|
|
// Use of this source code is governed by an ISC
|
|
// license that can be found in the LICENSE file.
|
|
|
|
/*
|
|
Package mining includes all mining and policy types, and will house all mining
|
|
code in the future.
|
|
|
|
It is currently a work in progress.
|
|
*/
|
|
package mining
|