mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 23:26:44 +00:00
14 lines
395 B
Go
14 lines
395 B
Go
package ethclient
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
// GetRootHash returns the merkle root of the block headers
|
|
func (ec *Client) GetRootHash(ctx context.Context, startBlockNumber uint64, endBlockNumber uint64) (string, error) {
|
|
var rootHash string
|
|
if err := ec.c.CallContext(ctx, &rootHash, "eth_getRootHash", startBlockNumber, endBlockNumber); err != nil {
|
|
return "", err
|
|
}
|
|
return rootHash, nil
|
|
}
|