@@ -35,7 +35,6 @@ import (
3535 "github.com/ethereum/go-ethereum/beacon/blsync"
3636 "github.com/ethereum/go-ethereum/cmd/utils"
3737 "github.com/ethereum/go-ethereum/common"
38- "github.com/ethereum/go-ethereum/common/hexutil"
3938 "github.com/ethereum/go-ethereum/crypto"
4039 "github.com/ethereum/go-ethereum/eth/catalyst"
4140 "github.com/ethereum/go-ethereum/eth/ethconfig"
@@ -273,11 +272,11 @@ func makeFullNode(ctx *cli.Context) *node.Node {
273272 // Configure synchronization override service
274273 var synctarget common.Hash
275274 if ctx .IsSet (utils .SyncTargetFlag .Name ) {
276- hex := hexutil . MustDecode ( ctx .String (utils .SyncTargetFlag .Name ) )
277- if len ( hex ) != common .HashLength {
278- utils .Fatalf ("invalid sync target length: have %d, want %d " , len ( hex ), common . HashLength )
275+ target := ctx .String (utils .SyncTargetFlag .Name )
276+ if ! common .IsHexHash ( target ) {
277+ utils .Fatalf ("sync target hash is not a valid hex hash: %s " , target )
279278 }
280- synctarget = common .BytesToHash ( hex )
279+ synctarget = common .HexToHash ( target )
281280 }
282281 utils .RegisterSyncOverrideService (stack , eth , synctarget , ctx .Bool (utils .ExitWhenSyncedFlag .Name ))
283282
0 commit comments