aboutsummaryrefslogtreecommitdiffstats
path: root/eth/downloader/modes.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-02-27 19:22:33 +0800
committerPéter Szilágyi <peterke@gmail.com>2017-02-27 19:22:33 +0800
commit8676aeb798f575024e173ca5c677aaee32e77725 (patch)
tree4f20591ccc4b60ceca0379a20074df856a3d2be7 /eth/downloader/modes.go
parent46eea4d10533f9376e0d36255dfc1083e28d5bbc (diff)
downloaddexon-8676aeb798f575024e173ca5c677aaee32e77725.tar.gz
dexon-8676aeb798f575024e173ca5c677aaee32e77725.tar.zst
dexon-8676aeb798f575024e173ca5c677aaee32e77725.zip
eth/downloader: review fixes
Diffstat (limited to 'eth/downloader/modes.go')
-rw-r--r--eth/downloader/modes.go18
1 files changed, 12 insertions, 6 deletions
diff --git a/eth/downloader/modes.go b/eth/downloader/modes.go
index c2ce0cfef..ae3c43888 100644
--- a/eth/downloader/modes.go
+++ b/eth/downloader/modes.go
@@ -25,10 +25,16 @@ const (
LightSync // Download only the headers and terminate afterwards
)
-// syncModeLabels contains a mapping of sync modes to textual label used by the
-// logging system.
-var syncModeLabels = map[SyncMode]string{
- FullSync: "full",
- FastSync: "fast",
- LightSync: "light",
+// String implements the stringer interface.
+func (mode SyncMode) String() string {
+ switch mode {
+ case FullSync:
+ return "full"
+ case FastSync:
+ return "fast"
+ case LightSync:
+ return "light"
+ default:
+ return "unknown"
+ }
}