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

implement miner_setExtra API method #569

Merged
merged 2 commits into from Apr 18, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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