-// ProcessTransaction is the main entry for txpool handle new tx
-func (tp *TxPool) ProcessTransaction(tx *types.Tx, statusFail bool, height, fee uint64) (bool, error) {
+func isTransactionNoBtmInput(tx *types.Tx) bool {
+ for _, input := range tx.TxData.Inputs {
+ switch input.InputType() {
+ case types.CrossChainInputType:
+ return false
+ }
+ if input.AssetID() == *consensus.BTMAssetID {
+ return false
+ }
+ }
+
+ return true
+}
+
+func isTransactionZeroOutput(tx *types.Tx) bool {
+ for _, output := range tx.TxData.Outputs {
+ if value := output.AssetAmount(); value.Amount == uint64(0) {
+ return true
+ }
+ }
+ return false
+}
+
+func (tp *TxPool) IsDust(tx *types.Tx) bool {
+ return isTransactionNoBtmInput(tx) || isTransactionZeroOutput(tx)
+}
+
+func (tp *TxPool) processTransaction(tx *types.Tx, statusFail bool, height, fee uint64) (bool, error) {