@@ -47,6 +47,7 @@ import (
47
47
"github.com/ethereum/go-ethereum/p2p/discover"
48
48
"github.com/ethereum/go-ethereum/p2p/nat"
49
49
"github.com/ethereum/go-ethereum/params"
50
+ "github.com/ethereum/go-ethereum/pow"
50
51
"github.com/ethereum/go-ethereum/rpc"
51
52
"github.com/ethereum/go-ethereum/whisper"
52
53
)
@@ -228,6 +229,10 @@ var (
228
229
Name : metrics .MetricsEnabledFlag ,
229
230
Usage : "Enable metrics collection and reporting" ,
230
231
}
232
+ FakePoWFlag = cli.BoolFlag {
233
+ Name : "fakepow" ,
234
+ Usage : "Disables proof-of-work verification" ,
235
+ }
231
236
232
237
// RPC settings
233
238
RPCEnabledFlag = cli.BoolFlag {
@@ -842,11 +847,13 @@ func MakeChain(ctx *cli.Context) (chain *core.BlockChain, chainDb ethdb.Database
842
847
glog .Fatalln (err )
843
848
}
844
849
}
845
-
846
850
chainConfig := MustMakeChainConfigFromDb (ctx , chainDb )
847
851
848
- var eventMux event.TypeMux
849
- chain , err = core .NewBlockChain (chainDb , chainConfig , ethash .New (), & eventMux )
852
+ pow := pow .PoW (core.FakePow {})
853
+ if ! ctx .GlobalBool (FakePoWFlag .Name ) {
854
+ pow = ethash .New ()
855
+ }
856
+ chain , err = core .NewBlockChain (chainDb , chainConfig , pow , new (event.TypeMux ))
850
857
if err != nil {
851
858
Fatalf ("Could not start chainmanager: %v" , err )
852
859
}
0 commit comments