From 72dcd3c58bec0a281280d5d42ed53b6e429ce4af Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Mon, 13 Feb 2017 21:44:06 +0100 Subject: core, eth, internal: Added `debug_getBadBlocks()` method (#3654) * core,eth,internal: Added `debug_getBadBlocks()` method When bad blocks are discovered, these are stored within geth. An RPC-endpoint makes them availablewithin the `debug` namespace. This feature makes it easier to discover network forks. ``` * core, api: go format + docs * core/blockchain: Documentation, fix minor nitpick * core: fix failing blockchain test --- eth/api.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'eth') diff --git a/eth/api.go b/eth/api.go index 07df0b79e..f38c0a6b6 100644 --- a/eth/api.go +++ b/eth/api.go @@ -566,3 +566,9 @@ func (api *PrivateDebugAPI) Preimage(ctx context.Context, hash common.Hash) (hex db := core.PreimageTable(api.eth.ChainDb()) return db.Get(hash.Bytes()) } + +// GetBadBLocks returns a list of the last 'bad blocks' that the client has seen on the network +// and returns them as a JSON list of block-hashes +func (api *PrivateDebugAPI) GetBadBlocks(ctx context.Context) ([]core.BadBlockArgs, error) { + return api.eth.BlockChain().BadBlocks() +} -- cgit