Skip to content

Commit

Permalink
Improve error logic in state processor
Browse files Browse the repository at this point in the history
  • Loading branch information
Djadih committed Dec 16, 2024
1 parent 9dc7043 commit a0fc38f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions core/state_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,7 @@ func RedeemLockedQuai(hc *HeaderChain, header *types.WorkObject, parent *types.W
if types.IsConversionTx(etx) && etx.To().IsInQuaiLedgerScope() && conversionPeriodValid {
internal, err := etx.To().InternalAddress()
if err != nil {
fmt.Errorf("Error converting address to internal address: %v", err)
return fmt.Errorf("Error converting address to internal address: %v", err), nil
}
balance := etx.Value()
if !statedb.Exist(internal) {
Expand Down Expand Up @@ -1501,10 +1501,12 @@ func (p *StateProcessor) Apply(batch ethdb.Batch, block *types.WorkObject) ([]*t
return nil, nil, err
}
if block.Hash() != blockHash {
err := errors.New("block hash changed after processing the block")
p.logger.WithFields(log.Fields{
"oldHash": blockHash,
"newHash": block.Hash(),
}).Warn("Block hash changed after Processing the block")
}).Error(err)
return nil, nil, err
}
time3 := common.PrettyDuration(time.Since(start))
err = p.validator.ValidateState(block, statedb, receipts, etxs, multiSet, usedGas, usedState)
Expand Down

0 comments on commit a0fc38f

Please sign in to comment.