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 #573 from ethereumproject/feax/api-debug_setHead
Browse files Browse the repository at this point in the history
implement missing debug_setHead api method
  • Loading branch information
whilei authored May 1, 2018
2 parents 4621800 + 69bbc77 commit 6c16fad
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions eth/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -1773,6 +1773,13 @@ func (api *PublicDebugAPI) SeedHash(number uint64) (string, error) {
return fmt.Sprintf("0x%x", hash), nil
}

func (api *PublicDebugAPI) SetHead(number uint64) (bool, error) {
if e := api.eth.BlockChain().SetHead(number); e != nil {
return false, e
}
return true, nil
}

// Metrics return all available registered metrics for the client.
// See https://github.com/ethereumproject/go-ethereum/wiki/Metrics-and-Monitoring for prophetic documentation.
func (api *PublicDebugAPI) Metrics(raw bool) (map[string]interface{}, error) {
Expand Down

0 comments on commit 6c16fad

Please sign in to comment.