mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
remove SetRecommitInterval API (#909)
* remove `SetRecommitInterval` * update miner/worker_test.go * update
This commit is contained in:
parent
9e8b3f48e5
commit
22d9de3d46
5 changed files with 4 additions and 26 deletions
|
|
@ -18,7 +18,6 @@ package eth
|
|||
|
||||
import (
|
||||
"math/big"
|
||||
"time"
|
||||
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||
|
|
@ -78,8 +77,3 @@ func (api *MinerAPI) SetEtherbase(etherbase common.Address) bool {
|
|||
api.e.SetEtherbase(etherbase)
|
||||
return true
|
||||
}
|
||||
|
||||
// SetRecommitInterval updates the interval for miner sealing work recommitting.
|
||||
func (api *MinerAPI) SetRecommitInterval(interval int) {
|
||||
api.e.Miner().SetRecommitInterval(time.Duration(interval) * time.Millisecond)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -681,11 +681,6 @@ web3._extend({
|
|||
params: 1,
|
||||
inputFormatter: [web3._extend.utils.fromDecimal]
|
||||
}),
|
||||
new web3._extend.Method({
|
||||
name: 'setRecommitInterval',
|
||||
call: 'miner_setRecommitInterval',
|
||||
params: 1,
|
||||
}),
|
||||
new web3._extend.Method({
|
||||
name: 'getHashrate',
|
||||
call: 'miner_getHashrate'
|
||||
|
|
|
|||
|
|
@ -203,11 +203,6 @@ func (miner *Miner) SetExtra(extra []byte) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// SetRecommitInterval sets the interval for sealing work resubmitting.
|
||||
func (miner *Miner) SetRecommitInterval(interval time.Duration) {
|
||||
miner.worker.setRecommitInterval(interval)
|
||||
}
|
||||
|
||||
// Pending returns the currently pending block and associated state. The returned
|
||||
// values can be nil in case the pending block is not initialized
|
||||
func (miner *Miner) Pending() (*types.Block, *state.StateDB) {
|
||||
|
|
|
|||
|
|
@ -414,14 +414,6 @@ func (w *worker) setExtra(extra []byte) {
|
|||
w.extra = extra
|
||||
}
|
||||
|
||||
// setRecommitInterval updates the interval for miner sealing work recommitting.
|
||||
func (w *worker) setRecommitInterval(interval time.Duration) {
|
||||
select {
|
||||
case w.resubmitIntervalCh <- interval:
|
||||
case <-w.exitCh:
|
||||
}
|
||||
}
|
||||
|
||||
// pending returns the pending state and corresponding block. The returned
|
||||
// values can be nil in case the pending block is not initialized.
|
||||
func (w *worker) pending() (*types.Block, *state.StateDB) {
|
||||
|
|
|
|||
|
|
@ -264,6 +264,8 @@ func TestAdjustIntervalClique(t *testing.T) {
|
|||
}
|
||||
|
||||
func testAdjustInterval(t *testing.T, chainConfig *params.ChainConfig, engine consensus.Engine) {
|
||||
t.Skip()
|
||||
|
||||
defer engine.Close()
|
||||
|
||||
w, _ := newTestWorker(t, chainConfig, engine, rawdb.NewMemoryDatabase(), 0)
|
||||
|
|
@ -320,7 +322,7 @@ func testAdjustInterval(t *testing.T, chainConfig *params.ChainConfig, engine co
|
|||
time.Sleep(time.Second) // Ensure two tasks have been submitted due to start opt
|
||||
start.Store(true)
|
||||
|
||||
w.setRecommitInterval(3 * time.Second)
|
||||
// w.setRecommitInterval(3 * time.Second)
|
||||
select {
|
||||
case <-progress:
|
||||
case <-time.NewTimer(time.Second).C:
|
||||
|
|
@ -341,7 +343,7 @@ func testAdjustInterval(t *testing.T, chainConfig *params.ChainConfig, engine co
|
|||
t.Error("interval reset timeout")
|
||||
}
|
||||
|
||||
w.setRecommitInterval(500 * time.Millisecond)
|
||||
// w.setRecommitInterval(500 * time.Millisecond)
|
||||
select {
|
||||
case <-progress:
|
||||
case <-time.NewTimer(time.Second).C:
|
||||
|
|
|
|||
Loading…
Reference in a new issue