Skip to content

Commit

Permalink
Merge pull request #67 from bladehan1/fea-prevent-snapsync
Browse files Browse the repository at this point in the history
chg(interface):only support full sync
  • Loading branch information
bladehan1 authored Mar 6, 2024
2 parents b87e27e + 6264759 commit d28b8bc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions cmd/geth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,12 @@ func main() {
// prepare manipulates memory cache allowance and setups metric system.
// This function should be called before launching devp2p stack.
func prepare(ctx *cli.Context) {
//only support full sync
err := ctx.Set(utils.SyncModeFlag.Name, "full")
if err != nil {
log.Warn("Failed to set sync mode to full")
}

// If we're running a known preset, log it for convenience.
switch {
case ctx.GlobalIsSet(utils.RopstenFlag.Name):
Expand Down
2 changes: 1 addition & 1 deletion cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ var (
defaultSyncMode = ethconfig.Defaults.SyncMode
SyncModeFlag = TextMarshalerFlag{
Name: "syncmode",
Usage: `Blockchain sync mode ("fast", "full", "snap" or "light")`,
Usage: `Blockchain sync mode (only "full" sync supported)`,
Value: &defaultSyncMode,
}
GCModeFlag = cli.StringFlag{
Expand Down
2 changes: 1 addition & 1 deletion eth/ethconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ var LightClientGPO = gasprice.Config{

// Defaults contains default settings for use on the Ethereum main net.
var Defaults = Config{
SyncMode: downloader.SnapSync,
SyncMode: downloader.FullSync,
Ethash: ethash.Config{
CacheDir: "ethash",
CachesInMem: 2,
Expand Down

0 comments on commit d28b8bc

Please sign in to comment.