OSDN Git Service

init push for easy code review (#121)
[bytom/vapor.git] / wallet / indexer.go
index 2fde9ae..f3b7d57 100644 (file)
@@ -88,12 +88,10 @@ func saveExternalAssetDefinition(b *types.Block, walletDB dbm.DB) {
 
        for _, tx := range b.Transactions {
                for _, orig := range tx.Inputs {
-                       if ii, ok := orig.TypedInput.(*types.IssuanceInput); ok {
-                               if isValidJSON(ii.AssetDefinition) {
-                                       assetID := ii.AssetID()
-                                       if assetExist := walletDB.Get(asset.ExtAssetKey(&assetID)); assetExist == nil {
-                                               storeBatch.Set(asset.ExtAssetKey(&assetID), ii.AssetDefinition)
-                                       }
+                       if cci, ok := orig.TypedInput.(*types.CrossChainInput); ok {
+                               assetID := cci.AssetId
+                               if assetExist := walletDB.Get(asset.ExtAssetKey(assetID)); assetExist == nil {
+                                       storeBatch.Set(asset.ExtAssetKey(assetID), cci.AssetDefinition)
                                }
                        }
                }