aboutsummaryrefslogtreecommitdiffstats
path: root/eth/api.go
diff options
context:
space:
mode:
authorNick Johnson <arachnid@notdot.net>2017-01-17 19:19:50 +0800
committerFelix Lange <fjl@users.noreply.github.com>2017-01-17 19:19:50 +0800
commit17d92233d9e64b642fed9a992556f7ff7d6fda18 (patch)
treee655a85d9d31c3377aef21b441c8b2c44df0aeff /eth/api.go
parent26d385c18b5eb003d9a69ff618c78acbe594db44 (diff)
downloaddexon-17d92233d9e64b642fed9a992556f7ff7d6fda18.tar
dexon-17d92233d9e64b642fed9a992556f7ff7d6fda18.tar.gz
dexon-17d92233d9e64b642fed9a992556f7ff7d6fda18.tar.bz2
dexon-17d92233d9e64b642fed9a992556f7ff7d6fda18.tar.lz
dexon-17d92233d9e64b642fed9a992556f7ff7d6fda18.tar.xz
dexon-17d92233d9e64b642fed9a992556f7ff7d6fda18.tar.zst
dexon-17d92233d9e64b642fed9a992556f7ff7d6fda18.zip
cmd/geth, core: add support for recording SHA3 preimages (#3543)
Diffstat (limited to 'eth/api.go')
-rw-r--r--eth/api.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/eth/api.go b/eth/api.go
index 023e9a9bb..07df0b79e 100644
--- a/eth/api.go
+++ b/eth/api.go
@@ -560,3 +560,9 @@ func (api *PrivateDebugAPI) TraceTransaction(ctx context.Context, txHash common.
}
return nil, errors.New("database inconsistency")
}
+
+// Preimage is a debug API function that returns the preimage for a sha3 hash, if known.
+func (api *PrivateDebugAPI) Preimage(ctx context.Context, hash common.Hash) (hexutil.Bytes, error) {
+ db := core.PreimageTable(api.eth.ChainDb())
+ return db.Get(hash.Bytes())
+}