}
func checkGasInputIDs(tx *types.Tx) error {
- crossChainInputNum := 0
for _, inp := range tx.Inputs {
switch inp.InputType() {
case types.CrossChainInputType:
- crossChainInputNum++
+ return nil
}
}
- if crossChainInputNum != len(tx.Inputs) && len(tx.GasInputIDs) == 0 {
+ if len(tx.GasInputIDs) == 0 {
return ErrNoGasInput
}
return nil
}
func isTransactionNoBtmInput(tx *types.Tx) bool {
- crossChainInputNum := 0
for _, input := range tx.TxData.Inputs {
- if input.AssetID() == *consensus.BTMAssetID {
- return false
- }
switch input.InputType() {
case types.CrossChainInputType:
- crossChainInputNum++
+ return false
+ }
+ if input.AssetID() == *consensus.BTMAssetID {
+ return false
}
}
- if crossChainInputNum == len(tx.TxData.Inputs) {
- return false
- }
+
return true
}