OSDN Git Service

edit the filter (#550)
[bytom/vapor.git] / protocol / asset_filter.go
index cd9fccd..fe7ec25 100644 (file)
@@ -3,7 +3,7 @@ package protocol
 import (
        "strings"
 
-       "github.com/bytom/vapor/consensus"
+       "github.com/bytom/vapor/common"
        "github.com/bytom/vapor/protocol/bc/types"
 )
 
@@ -16,7 +16,6 @@ type AssetFilter struct {
 // which is a strings list cancated via comma
 func NewAssetFilter(whitelist string) *AssetFilter {
        af := &AssetFilter{whitelist: make(map[string]struct{})}
-       af.whitelist[consensus.BTMAssetID.String()] = struct{}{}
        for _, assetID := range strings.Split(whitelist, ",") {
                af.whitelist[strings.ToLower(assetID)] = struct{}{}
        }
@@ -28,7 +27,7 @@ func NewAssetFilter(whitelist string) *AssetFilter {
 // No need to check the output assets types becauese they must have been cover in input assets types
 func (af *AssetFilter) IsDust(tx *types.Tx) bool {
        for _, input := range tx.Inputs {
-               if _, ok := input.TypedInput.(*types.CrossChainInput); !ok {
+               if crossChainInput, ok := input.TypedInput.(*types.CrossChainInput); !ok || !common.IsOpenFederationIssueAsset(crossChainInput.AssetDefinition) {
                        continue
                }