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

implement missing debug_setHead api method #573

Merged
merged 1 commit into from
May 1, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

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