cmd/geth, core: add support for recording SHA3 preimages (#3543)
This commit is contained in:
committed by
Felix Lange
parent
26d385c18b
commit
17d92233d9
@@ -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())
|
||||
}
|
||||
|
Reference in New Issue
Block a user