Merge pull request #407 from thanhson1085/master

fix bug receipt status
This commit is contained in:
Nguyen Sy Thanh Son 2019-01-15 00:07:03 +07:00 committed by GitHub
commit fe448f6a50
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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
for _, r := range receipts {
if r.TxHash == tx.Hash() {
if len(r.PostState) > 0 {
b = types.ReceiptStatusSuccessful
} else {
b = r.Status
}
break
}
}
if b == types.ReceiptStatusFailed {
log.Debug("Sign tx failed", "hash", tx.Hash().String())
continue
}

View file

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