diff options
Diffstat (limited to 'eth/api.go')
-rw-r--r-- | eth/api.go | 6 |
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()) +} |