From 3c7ced7e1e5d02d320112dfba65bd5e675764f3e Mon Sep 17 00:00:00 2001 From: Nguyen Sy Thanh Son Date: Fri, 4 Jan 2019 09:42:41 +0000 Subject: [PATCH] check tx receipt status --- consensus/posv/posv.go | 13 +++++++++++++ contracts/utils.go | 1 - 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/consensus/posv/posv.go b/consensus/posv/posv.go index 6e0cfef64f..7fd611fb85 100644 --- a/consensus/posv/posv.go +++ b/consensus/posv/posv.go @@ -867,6 +867,19 @@ func (c *Posv) Finalize(chain consensus.ChainReader, header *types.Header, state blkHash := common.BytesToHash(tx.Data()[len(tx.Data())-32:]) from := *tx.From() + var b uint + for _, r := range receipts { + if r.TxHash == tx.Hash() { + b = r.Status + break + } + } + + if b == types.ReceiptStatusFailed { + fmt.Println("Tx receipt status false") + continue + } + var lAddr []common.Address if cached, ok := c.BlockSigners.Get(blkHash); ok { lAddr = cached.([]common.Address) diff --git a/contracts/utils.go b/contracts/utils.go index fb63499e78..b42df94207 100644 --- a/contracts/utils.go +++ b/contracts/utils.go @@ -397,7 +397,6 @@ func GetRewardForCheckpoint(c *posv.Posv, chain consensus.ChainReader, blockSign wg.Wait() } - fmt.Println("c.BlockSigners.Len()", c.BlockSigners.Len()) fmt.Println("totalSigner", *totalSigner) }