OSDN Git Service

fix logic for https://github.com/Bytom/vapor/pull/181#discussion_r294070592
authorHAOYUatHZ <haoyu@protonmail.com>
Mon, 17 Jun 2019 01:55:16 +0000 (09:55 +0800)
committerHAOYUatHZ <haoyu@protonmail.com>
Mon, 17 Jun 2019 01:55:16 +0000 (09:55 +0800)
federation/warder.go

index 23eac76..d7a936a 100644 (file)
@@ -143,18 +143,9 @@ func (w *warder) validateCrossTx(tx *orm.CrossTransaction) error {
                return errors.New("cross-chain tx submitted")
        case common.CrossTxCompletedStatus:
                return errors.New("cross-chain tx completed")
+       default:
+               return nil
        }
-
-       crossTxReqs := []*orm.CrossTransactionReq{}
-       if err := w.db.Where(&orm.CrossTransactionReq{CrossTransactionID: tx.ID}).Find(&crossTxReqs).Error; err != nil {
-               return err
-       }
-
-       if len(crossTxReqs) != len(tx.Reqs) {
-               return errors.New("cross-chain requests count mismatch")
-       }
-
-       return nil
 }
 
 func (w *warder) proposeDestTx(tx *orm.CrossTransaction) (interface{}, string, error) {