import (
"strings"
- "github.com/bytom/vapor/consensus"
+ "github.com/bytom/vapor/common"
"github.com/bytom/vapor/protocol/bc/types"
)
// 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{}{}
}
// 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
}