From: ipqhjjybj <250657661@qq.com> Date: Thu, 26 Dec 2019 06:02:49 +0000 (+0800) Subject: Fix bug (#472) X-Git-Tag: v1.1.0~5 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=3adffe8810801582032e851f8ecb86cc83f253f4;p=bytom%2Fvapor.git Fix bug (#472) * fix bug for vote & normal output * 修复提交同样的错误交易时,放回成功的bug Co-authored-by: Colt-Z <453256728@qq.com> --- diff --git a/protocol/tx.go b/protocol/tx.go index f8636789..b5b4ec5e 100644 --- a/protocol/tx.go +++ b/protocol/tx.go @@ -27,9 +27,12 @@ func (c *Chain) ValidateTx(tx *types.Tx) (bool, error) { return false, nil } - c.markTransactions(tx) bh := c.BestBlockHeader() - return c.validateTx(tx, bh) + isOrphan, err := c.validateTx(tx, bh) + if err == nil { + c.markTransactions(tx) + } + return isOrphan, err } // validateTx validates the given transaction without checking duplication.