fix bug receipt status

This commit is contained in:
Nguyen Sy Thanh Son 2019-01-14 16:55:50 +00:00
parent 9a9ecc37a3
commit 8f4705c3a8
2 changed files with 11 additions and 5 deletions

View file

@ -1032,13 +1032,16 @@ func (c *Posv) CacheData(header *types.Header, txs []*types.Transaction, receipt
var b uint var b uint
for _, r := range receipts { for _, r := range receipts {
if r.TxHash == tx.Hash() { if r.TxHash == tx.Hash() {
b = r.Status if len(r.PostState) > 0 {
b = types.ReceiptStatusSuccessful
} else {
b = r.Status
}
break break
} }
} }
if b == types.ReceiptStatusFailed { if b == types.ReceiptStatusFailed {
log.Debug("Sign tx failed", "hash", tx.Hash().String())
continue continue
} }

View file

@ -340,13 +340,16 @@ func GetRewardForCheckpoint(c *posv.Posv, chain consensus.ChainReader, number ui
var b uint var b uint
for _, r := range receipts { for _, r := range receipts {
if r.TxHash == tx.Hash() { if r.TxHash == tx.Hash() {
b = r.Status if len(r.PostState) > 0 {
b = types.ReceiptStatusSuccessful
} else {
b = r.Status
}
break break
} }
} }
if b == types.ReceiptStatusFailed && i >= rCheckpoint { if b == types.ReceiptStatusFailed {
log.Debug("Sign tx failed", "hash", tx.Hash().String())
continue continue
} }