MinerAPI.Start¶
| Source (upstream pre-purge) | Current | |
|---|---|---|
| File | eth/api_miner.go |
api_miner_pow.go |
| Symbol | MinerAPI.Start |
MinerAPI.Start |
| Ref | d8e0807da~1 |
etc/v1.17.3-full-node |
miner_start RPC. Fork/core-geth take an optional thread count (the pre-purge took none).
3-way merge — purge → getc ← upstream¶
pre-purgecore-gethfork-only
↗// Start starts the miner with the given number of threads. If threads is nil,
// the number of workers used is the number of logical CPUs that are usable by
// the current process.
↗func (api *MinerAPI) Start(threads *int) error {
if threads == nil {
n := runtime.NumCPU()
threads = &n
↗ }
return api.e.StartMining(*threads)
↗}
core-geth validation — +4 -5
| | | |---|---| | File | [`api_miner.go`](https://github.com/etclabscore/core-geth/blob/v1.12.20/eth/api_miner.go) | | Symbol | `MinerAPI.Start` | | Ref | `v1.12.20` |--- a/core-geth/eth/api_miner.go
+++ b/etc/eth/api_miner_pow.go
@@ -1,11 +1,10 @@
// Start starts the miner with the given number of threads. If threads is nil,
-// the number of workers started is equal to the number of logical CPUs that are
-// usable by this process. If mining is already running, this method adjust the
-// number of threads allowed to use and updates the minimum price required by the
-// transaction pool.
+// the number of workers used is the number of logical CPUs that are usable by
+// the current process.
func (api *MinerAPI) Start(threads *int) error {
if threads == nil {
- return api.e.StartMining(runtime.NumCPU())
+ n := runtime.NumCPU()
+ threads = &n
}
return api.e.StartMining(*threads)
}