aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2020-02-24 19:09:22 -0500
committerDeterminant <[email protected]>2020-02-24 19:09:22 -0500
commit493d83fc02b04163602eb9c76ccf6b40cc3304ba (patch)
tree4e80802dffffb1482d132a4982db272f64f0b457
parenta29ec3a0ae86185db68e9be6557e1c8dde89a92c (diff)
add SetGCMode()
-rw-r--r--eth/config.go17
1 files 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 {