From 3adffe8810801582032e851f8ecb86cc83f253f4 Mon Sep 17 00:00:00 2001 From: ipqhjjybj <250657661@qq.com> Date: Thu, 26 Dec 2019 14:02:49 +0800 Subject: [PATCH] Fix bug (#472) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * fix bug for vote & normal output * 修复提交同样的错误交易时,放回成功的bug Co-authored-by: Colt-Z <453256728@qq.com> --- protocol/tx.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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. -- 2.11.0