aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/utils
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/utils')
-rw-r--r--cmd/utils/flags.go41
1 files changed, 18 insertions, 23 deletions
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go
index 4727e7cdf..c9115d7a3 100644
--- a/cmd/utils/flags.go
+++ b/cmd/utils/flags.go
@@ -1077,30 +1077,25 @@ func setEthash(ctx *cli.Context, cfg *eth.Config) {
}
func setWhitelist(ctx *cli.Context, cfg *eth.Config) {
- if ctx.GlobalIsSet(WhitelistFlag.Name) {
- entries := strings.Split(ctx.String(WhitelistFlag.Name), ",")
- whitelist := make(map[uint64]common.Hash)
- for _, entry := range entries {
- split := strings.SplitN(entry, "=", 2)
- if len(split) != 2 {
- Fatalf("invalid whitelist entry: %s", entry)
- }
-
- bn, err := strconv.ParseUint(split[0], 0, 64)
- if err != nil {
- Fatalf("Invalid whitelist block number %s: %v", split[0], err)
- }
-
- hash := common.Hash{}
- err = hash.UnmarshalText([]byte(split[1]))
- if err != nil {
- Fatalf("Invalid whitelist hash %s: %v", split[1], err)
- }
-
- whitelist[bn] = hash
+ whitelist := ctx.GlobalString(WhitelistFlag.Name)
+ if whitelist == "" {
+ return
+ }
+ cfg.Whitelist = make(map[uint64]common.Hash)
+ for _, entry := range strings.Split(whitelist, ",") {
+ parts := strings.Split(entry, "=")
+ if len(parts) != 2 {
+ Fatalf("Invalid whitelist entry: %s", entry)
}
-
- cfg.Whitelist = whitelist
+ number, err := strconv.ParseUint(parts[0], 0, 64)
+ if err != nil {
+ Fatalf("Invalid whitelist block number %s: %v", parts[0], err)
+ }
+ var hash common.Hash
+ if err = hash.UnmarshalText([]byte(parts[1])); err != nil {
+ Fatalf("Invalid whitelist hash %s: %v", parts[1], err)
+ }
+ cfg.Whitelist[number] = hash
}
}
d00ec7d364b069583c0a5e7194e2f15a42a94d'>3ad00ec7d364
9a9ac6ba9d74
3ad00ec7d364

bd132e4dbbfe



0f2995327470
ea2d2ccf3281
3ad00ec7d364
bc318710eeae



3ad00ec7d364
5ed28dbe7a2a
3ad00ec7d364
b652eb354236
8493a5819b74
5676988fbdae
8493a5819b74
2d86193b116d
3ad00ec7d364


5e9116e2ae8f
bc318710eeae
bb9bb9d9f5a2
2b68a0870413
f060d2868317
fda2e985daa2
bb9bb9d9f5a2
2b68a0870413
bb9bb9d9f5a2
bc318710eeae
47828d0fce17
bc318710eeae
67f03b4b384d


bc318710eeae
bb9bb9d9f5a2












28b9aac39080
08d053469912
f5251e7ff8cf

28b9aac39080
bc318710eeae

44e5d4aa86d4
8ebcd7cb694a
f060d2868317
0fac8b3bf5a4

bb9bb9d9f5a2





0fac8b3bf5a4
bb9bb9d9f5a2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78