OSDN Git Service

feat: add cross-chain output (#56)
[bytom/vapor.git] / protocol / txpool.go
index 4817b5e..7d6bf9f 100644 (file)
@@ -203,7 +203,8 @@ func isTransactionNoBtmInput(tx *types.Tx) bool {
 
 func isTransactionZeroOutput(tx *types.Tx) bool {
        for _, output := range tx.TxData.Outputs {
-               if output.Amount == uint64(0) {
+               value := output.AssetAmount()
+               if value.Amount == uint64(0) {
                        return true
                }
        }
@@ -276,7 +277,7 @@ func (tp *TxPool) addTransaction(txD *TxDesc) error {
        txD.Added = time.Now()
        tp.pool[tx.ID] = txD
        for _, id := range tx.ResultIds {
-               output, err := tx.Output(*id)
+               output, err := tx.IntraChainOutput(*id)
                if err != nil {
                        // error due to it's a retirement, utxo doesn't care this output type so skip it
                        continue