mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 15:16:43 +00:00
revert some changes
This commit is contained in:
parent
a4a39a4dd9
commit
be58978cdc
1 changed files with 8 additions and 8 deletions
|
|
@ -250,13 +250,13 @@ var (
|
|||
Name: "lightkdf",
|
||||
Usage: "Reduce key-derivation RAM & CPU usage at some expense of KDF strength",
|
||||
}
|
||||
EthRequiredBlocksFlag = cli.StringFlag{
|
||||
EthPeerRequiredBlocksFlag = cli.StringFlag{
|
||||
Name: "eth.requiredblocks",
|
||||
Usage: "Comma separated block number-to-hash mappings to require for peering (<number>=<hash>)",
|
||||
}
|
||||
LegacyWhitelistFlag = cli.StringFlag{
|
||||
Name: "whitelist",
|
||||
Usage: "Comma separated block number-to-hash mappings to enforce (<number>=<hash>) (deprecated in favor of --eth.requiredblocks)",
|
||||
Usage: "Comma separated block number-to-hash mappings to enforce (<number>=<hash>) (deprecated in favor of --peer.requiredblocks)",
|
||||
}
|
||||
BloomFilterSizeFlag = cli.Uint64Flag{
|
||||
Name: "bloomfilter.size",
|
||||
|
|
@ -1499,20 +1499,20 @@ func setMiner(ctx *cli.Context, cfg *miner.Config) {
|
|||
}
|
||||
}
|
||||
|
||||
func setRequiredBlocks(ctx *cli.Context, cfg *ethconfig.Config) {
|
||||
requiredBlocks := ctx.GlobalString(EthRequiredBlocksFlag.Name)
|
||||
func setPeerRequiredBlocks(ctx *cli.Context, cfg *ethconfig.Config) {
|
||||
peerRequiredBlocks := ctx.GlobalString(EthPeerRequiredBlocksFlag.Name)
|
||||
|
||||
if requiredBlocks == "" {
|
||||
if peerRequiredBlocks == "" {
|
||||
if ctx.GlobalIsSet(LegacyWhitelistFlag.Name) {
|
||||
log.Warn("The flag --whitelist is deprecated and will be removed, please use --eth.requiredblocks")
|
||||
requiredBlocks = ctx.GlobalString(LegacyWhitelistFlag.Name)
|
||||
peerRequiredBlocks = ctx.GlobalString(LegacyWhitelistFlag.Name)
|
||||
} else {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
cfg.PeerRequiredBlocks = make(map[uint64]common.Hash)
|
||||
for _, entry := range strings.Split(requiredBlocks, ",") {
|
||||
for _, entry := range strings.Split(peerRequiredBlocks, ",") {
|
||||
parts := strings.Split(entry, "=")
|
||||
if len(parts) != 2 {
|
||||
Fatalf("Invalid required block entry: %s", entry)
|
||||
|
|
@ -1592,7 +1592,7 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
|
|||
setTxPool(ctx, &cfg.TxPool)
|
||||
setEthash(ctx, cfg)
|
||||
setMiner(ctx, &cfg.Miner)
|
||||
setRequiredBlocks(ctx, cfg)
|
||||
setPeerRequiredBlocks(ctx, cfg)
|
||||
setLes(ctx, cfg)
|
||||
|
||||
if ctx.GlobalIsSet(BorLogsFlag.Name) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue