OSDN Git Service

convert assetID to lower-case
authorHAOYUatHZ <haoyu@protonmail.com>
Sat, 15 Feb 2020 10:19:24 +0000 (18:19 +0800)
committerHAOYUatHZ <haoyu@protonmail.com>
Sat, 15 Feb 2020 10:19:24 +0000 (18:19 +0800)
protocol/asset_filter.go

index e299f01..1cf51f8 100644 (file)
@@ -14,8 +14,8 @@ type assetFilter struct {
 func NewAssetFilter(whitelist string) *assetFilter {
        af := &assetFilter{whitelist: make(map[string]struct{})}
        af.whitelist[consensus.BTMAssetID.String()] = struct{}{}
-       for _, asset := range strings.Split(whitelist, ",") {
-               af.whitelist[asset] = struct{}{}
+       for _, assetID := range strings.Split(whitelist, ",") {
+               af.whitelist[strings.ToLower(assetID)] = struct{}{}
        }
        return af
 }