Skip to content

Commit

Permalink
Fix wrong order of distributeIncoming and `distributeFinalityReward…
Browse files Browse the repository at this point in the history
…` issue
  • Loading branch information
pythonberg1997 committed Apr 26, 2022
1 parent e310c1b commit a0ac519
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions consensus/parlia/parlia.go
Original file line number Diff line number Diff line change
Expand Up @@ -1110,15 +1110,17 @@ func (p *Parlia) FinalizeAndAssemble(chain consensus.ChainHeaderReader, header *
}
}

err := p.distributeIncoming(p.val, state, header, cx, &txs, &receipts, nil, &header.GasUsed, true)
if err != nil {
return nil, nil, err
}

if p.chainConfig.IsLynn(header.Number) {
if err := p.distributeFinalityReward(chain, state, header, cx, &txs, &receipts, nil, &header.GasUsed, true); err != nil {
return nil, nil, err
}
}
err := p.distributeIncoming(p.val, state, header, cx, &txs, &receipts, nil, &header.GasUsed, true)
if err != nil {
return nil, nil, err
}

// should not happen. Once happen, stop the node is better than broadcast the block
if header.GasLimit < header.GasUsed {
return nil, nil, errors.New("gas consumption of system txs exceed the gas limit")
Expand Down

0 comments on commit a0ac519

Please sign in to comment.