Golang implemented sidechain for Bytom
修订版 | f2fd7c3f11e9b35bf753eda4dcd46ca435cc6ca3 (tree) |
---|---|
时间 | 2019-11-25 11:03:47 |
作者 | paladz <453256728@qq.c...> |
Commiter | paladz |
submit tx protocol verify
@@ -49,6 +49,14 @@ func (c *Chain) validateTx(tx *types.Tx, bh *types.BlockHeader) (bool, error) { | ||
49 | 49 | return false, err |
50 | 50 | } |
51 | 51 | |
52 | + txVerifyResult := &bc.TxVerifyResult{StatusFail: err != nil} | |
53 | + for _, p := range c.subProtocols { | |
54 | + if err := p.ValidateTx(tx, txVerifyResult); err != nil { | |
55 | + c.txPool.AddErrCache(&tx.ID, err) | |
56 | + return false, err | |
57 | + } | |
58 | + } | |
59 | + | |
52 | 60 | if err != nil { |
53 | 61 | log.WithFields(log.Fields{"module": logModule, "tx_id": tx.Tx.ID.String(), "error": err}).Info("transaction status fail") |
54 | 62 | } |