miner/miner.go¶
| Type | MOD |
| Upstream Lines | 176 |
| Changed | +12 -0 |
Add PoW mining config fields (Notify, NotifyFull, Noverify) consumed by the revived worker
diff --git a/miner/miner.go b/miner/miner.go
index 0ff0237a0..0cb687b6f 100644
--- a/miner/miner.go
+++ b/miner/miner.go
@@ -31,6 +31,7 @@ import (
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/txpool"
"github.com/ethereum/go-ethereum/core/types"
+ "github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/params"
)
@@ -50,6 +51,9 @@ type Config struct {
GasPrice *big.Int // Minimum gas price for mining a transaction
Recommit time.Duration // The time interval for miner to re-create mining work.
MaxBlobsPerBlock int // Maximum number of blobs per block (0 for unset uses protocol default)
+ Notify []string `toml:",omitempty"` // HTTP URL list to be notified of new work packages (only useful in ethash).
+ NotifyFull bool `toml:",omitempty"` // Notify with pending block headers instead of work packages
+ Noverify bool // Disable remote mining solution verification (only useful in ethash).
}
// DefaultConfig contains default settings for miner.
@@ -76,6 +80,14 @@ type Miner struct {
chain *core.BlockChain
pending *pending
pendingMu sync.Mutex // Lock protects the pending block
+
+ // PoW mining fields (nil for PoS chains)
+ mux *event.TypeMux
+ powWorker *powWorker
+ exitCh chan struct{}
+ startCh chan struct{}
+ stopCh chan struct{}
+ wg sync.WaitGroup
}
// New creates a new miner with provided config.