Skip to content

Commit

Permalink
fix for bad history
Browse files Browse the repository at this point in the history
  • Loading branch information
blxdyx committed Oct 15, 2024
1 parent 671833a commit d7adc7f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions consensus/parlia/parlia.go
Original file line number Diff line number Diff line change
Expand Up @@ -1417,6 +1417,9 @@ func (p *Parlia) distributeToSystem(val libcommon.Address, ibs *state.IntraBlock
usedGas *uint64, mining bool, systemTxCall consensus.SystemTxCall, curIndex, txIndex *int) (bool, error) {
if *curIndex == *txIndex {
balance := ibs.GetBalance(consensus.SystemAddress).Clone()
if _, ok := ibs.StateReader.(*state.HistoryReaderV3); ok {
balance = (*txs)[*curIndex].GetValue()
}
if balance.Cmp(u256.Num0) <= 0 {
return false, nil
}
Expand Down Expand Up @@ -1446,6 +1449,9 @@ func (p *Parlia) distributeToValidator(val libcommon.Address, ibs *state.IntraBl

if *curIndex == *txIndex {
balance := ibs.GetBalance(consensus.SystemAddress).Clone()
if _, ok := ibs.StateReader.(*state.HistoryReaderV3); ok {
balance = (*txs)[*curIndex].GetValue()
}

if balance.Cmp(u256.Num0) <= 0 {
return false, nil
Expand Down

0 comments on commit d7adc7f

Please sign in to comment.