OSDN Git Service

add btm asset
authoroysheng <oysheng@bytom.io>
Wed, 18 Apr 2018 12:56:57 +0000 (20:56 +0800)
committeroysheng <oysheng@bytom.io>
Wed, 18 Apr 2018 12:56:57 +0000 (20:56 +0800)
asset/asset.go

index 7c3cf44..5528684 100644 (file)
@@ -285,6 +285,11 @@ func (reg *Registry) GetAliasByID(id string) string {
 // GetAsset get asset by assetID
 func (reg *Registry) GetAsset(id string) (*Asset, error) {
        asset := &Asset{}
+
+       if strings.Compare(id, DefaultNativeAsset.AssetID.String()) == 0 {
+               return DefaultNativeAsset, nil
+       }
+
        if interAsset := reg.db.Get([]byte(assetPrefix + id)); interAsset != nil {
                if err := json.Unmarshal(interAsset, asset); err != nil {
                        return nil, err