aboutsummaryrefslogtreecommitdiffstats
path: root/eth
diff options
context:
space:
mode:
authorMartin Holst Swende <martin@swende.se>2017-02-14 04:44:06 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2017-02-14 04:44:06 +0800
commit72dcd3c58bec0a281280d5d42ed53b6e429ce4af (patch)
treeb14f34e256b0a2aaa71413bfa3fc66f52edc92d9 /eth
parent4ece9c6cb0a75e0ba6c67f8b1e5200f652e5b3d4 (diff)
downloadgo-tangerine-72dcd3c58bec0a281280d5d42ed53b6e429ce4af.tar
go-tangerine-72dcd3c58bec0a281280d5d42ed53b6e429ce4af.tar.gz
go-tangerine-72dcd3c58bec0a281280d5d42ed53b6e429ce4af.tar.bz2
go-tangerine-72dcd3c58bec0a281280d5d42ed53b6e429ce4af.tar.lz
go-tangerine-72dcd3c58bec0a281280d5d42ed53b6e429ce4af.tar.xz
go-tangerine-72dcd3c58bec0a281280d5d42ed53b6e429ce4af.tar.zst
go-tangerine-72dcd3c58bec0a281280d5d42ed53b6e429ce4af.zip
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
Diffstat (limited to 'eth')
-rw-r--r--eth/api.go6
1 files changed, 6 insertions, 0 deletions
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()
+}