OSDN Git Service

Merge pull request #41 from Bytom/dev
[bytom/vapor.git] / protocol / tx.go
index cf5598f..8ed6d7a 100644 (file)
@@ -29,6 +29,12 @@ func (c *Chain) ValidateTx(tx *types.Tx) (bool, error) {
        if ok := c.txPool.HaveTransaction(&tx.ID); ok {
                return false, c.txPool.GetErrCache(&tx.ID)
        }
+
+       if ok := c.txPool.IsWithdrawSpent(tx); ok {
+               log.WithFields(log.Fields{"module": "ValidateTx", "error": "Cliam transactions already exist in the trading pool"}).Error("chain error")
+               return false, errors.New("Cliam transactions already exist in the trading pool")
+       }
+
        bh := c.BestBlockHeader()
        block := types.MapBlock(&types.Block{BlockHeader: *bh})
        gasStatus, err := validation.ValidateTx(tx.Tx, block)