Skip to content
This repository has been archived by the owner on Oct 4, 2019. It is now read-only.

Commit

Permalink
Merge pull request #569 from ethereumproject/feax/miner-set-extra
Browse files Browse the repository at this point in the history
implement miner_setExtra API method
  • Loading branch information
whilei committed Apr 18, 2018
2 parents 2da9bee + f6142e0 commit 4621800
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions eth/api.go
Expand Up @@ -34,6 +34,7 @@ import (
"github.com/ethereumproject/go-ethereum/accounts"
"github.com/ethereumproject/go-ethereum/common"
"github.com/ethereumproject/go-ethereum/common/compiler"
"github.com/ethereumproject/go-ethereum/common/hexutil"
"github.com/ethereumproject/go-ethereum/core"
"github.com/ethereumproject/go-ethereum/core/state"
"github.com/ethereumproject/go-ethereum/core/types"
Expand Down Expand Up @@ -294,6 +295,16 @@ func (s *PrivateMinerAPI) StopAutoDAG() bool {
return true
}

// StopAutoDAG stops auto DAG generation
func (s *PrivateMinerAPI) SetExtra(b hexutil.Bytes) bool {
// types.HeaderExtraMax is the size limit for Header.Extra
if len(b) > types.HeaderExtraMax {
return false
}
miner.HeaderExtra = b
return true
}

// MakeDAG creates the new DAG for the given block number
func (s *PrivateMinerAPI) MakeDAG(blockNr rpc.BlockNumber) (bool, error) {
if err := ethash.MakeDAG(uint64(blockNr.Int64()), ""); err != nil {
Expand Down

0 comments on commit 4621800

Please sign in to comment.