From 493d83fc02b04163602eb9c76ccf6b40cc3304ba Mon Sep 17 00:00:00 2001 From: Determinant Date: Mon, 24 Feb 2020 19:09:22 -0500 Subject: add SetGCMode() --- eth/config.go | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/eth/config.go b/eth/config.go index 85abe7c..ee0fdb7 100644 --- a/eth/config.go +++ b/eth/config.go @@ -17,6 +17,7 @@ package eth import ( + "errors" "math/big" "os" "os/user" @@ -160,8 +161,20 @@ type Config struct { // Istanbul block override (TODO: remove after the fork) OverrideIstanbul *big.Int - // Manually select and grow the canonical chain - ManualCanonical bool + // Manually select and grow the canonical chain + ManualCanonical bool +} + +func (cfg *Config) SetGCMode(gcmode string) error { + switch gcmode { + case "full": + cfg.NoPruning = false + case "archive": + cfg.NoPruning = true + default: + return errors.New("invalid gcmode value") + } + return nil } func MyDefaultConfig() Config { -- cgit v1.2.3