aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2015-07-03 00:55:18 +0800
committerPéter Szilágyi <peterke@gmail.com>2015-08-24 22:57:28 +0800
commit42f44dda5468000b3b2c005ec485529bc5da3674 (patch)
treec93c9a2734adceac75e48f825076d48325826140 /cmd
parentc51e153b5c5327f971e7b410e49e7babfc3f0b8e (diff)
downloadgo-tangerine-42f44dda5468000b3b2c005ec485529bc5da3674.tar.gz
go-tangerine-42f44dda5468000b3b2c005ec485529bc5da3674.tar.zst
go-tangerine-42f44dda5468000b3b2c005ec485529bc5da3674.zip
eth, eth/downloader: handle header requests, table driven proto tests
Diffstat (limited to 'cmd')
-rw-r--r--cmd/geth/main.go2
-rw-r--r--cmd/utils/flags.go17
2 files changed, 19 insertions, 0 deletions
diff --git a/cmd/geth/main.go b/cmd/geth/main.go
index ff556c984..dc7e19c61 100644
--- a/cmd/geth/main.go
+++ b/cmd/geth/main.go
@@ -283,6 +283,7 @@ JavaScript API. See https://github.com/ethereum/go-ethereum/wiki/Javascipt-Conso
utils.DataDirFlag,
utils.BlockchainVersionFlag,
utils.OlympicFlag,
+ utils.EthVersionFlag,
utils.CacheFlag,
utils.JSpathFlag,
utils.ListenPortFlag,
@@ -333,6 +334,7 @@ JavaScript API. See https://github.com/ethereum/go-ethereum/wiki/Javascipt-Conso
app.Before = func(ctx *cli.Context) error {
utils.SetupLogger(ctx)
utils.SetupVM(ctx)
+ utils.SetupEth(ctx)
if ctx.GlobalBool(utils.PProfEanbledFlag.Name) {
utils.StartPProf(ctx)
}
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go
index af2929d10..5ebc4ea61 100644
--- a/cmd/utils/flags.go
+++ b/cmd/utils/flags.go
@@ -138,6 +138,11 @@ var (
Name: "olympic",
Usage: "Use olympic style protocol",
}
+ EthVersionFlag = cli.IntFlag{
+ Name: "eth",
+ Value: 61,
+ Usage: "Highest eth protocol to advertise (temporary, dev option)",
+ }
// miner settings
MinerThreadsFlag = cli.IntFlag{
@@ -459,6 +464,18 @@ func SetupVM(ctx *cli.Context) {
vm.SetJITCacheSize(ctx.GlobalInt(VMJitCacheFlag.Name))
}
+// SetupEth configures the eth packages global settings
+func SetupEth(ctx *cli.Context) {
+ version := ctx.GlobalInt(EthVersionFlag.Name)
+ for len(eth.ProtocolVersions) > 0 && eth.ProtocolVersions[0] > uint(version) {
+ eth.ProtocolVersions = eth.ProtocolVersions[1:]
+ eth.ProtocolLengths = eth.ProtocolLengths[1:]
+ }
+ if len(eth.ProtocolVersions) == 0 {
+ Fatalf("No valid eth protocols remaining")
+ }
+}
+
// MakeChain creates a chain manager from set command line flags.
func MakeChain(ctx *cli.Context) (chain *core.ChainManager, chainDb common.Database) {
datadir := ctx.GlobalString(DataDirFlag.Name)