Skip to content

miner/miner.go — Version Comparison

v1.16.8 v1.17.3
Branch etc/v1.16.8-full-node etc/v1.17.3-full-node
Delta +12 -0 +12 -0
ETC delta on v1.16.8 (+12 -0)
diff --git a/miner/miner.go b/miner/miner.go
index 810cc20a6..b17c9a95e 100644
--- a/miner/miner.go
+++ b/miner/miner.go
@@ -30,6 +30,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"
 )

@@ -48,6 +49,9 @@ type Config struct {
    GasCeil             uint64         // Target gas ceiling for mined blocks.
    GasPrice            *big.Int       // Minimum gas price for mining a transaction
    Recommit            time.Duration  // The time interval for miner to re-create mining work.
+   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.
@@ -74,6 +78,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.
ETC delta on v1.17.3 (+12 -0)
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.

← Back to Version Comparison