Skip to content

Commit

Permalink
concensus/parlia.go: make distribute incoming tx more independence
Browse files Browse the repository at this point in the history
  • Loading branch information
zlacfzy committed Oct 10, 2024
1 parent 5322ddf commit e86af0b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions consensus/parlia/parlia.go
Original file line number Diff line number Diff line change
Expand Up @@ -1816,14 +1816,15 @@ func (p *Parlia) distributeIncoming(val common.Address, state *state.StateDB, he
if doDistributeSysReward {
rewards := new(uint256.Int)
rewards = rewards.Rsh(balance, systemRewardPercent)
state.SetBalance(consensus.SystemAddress, balance.Sub(balance, rewards))
state.AddBalance(coinbase, rewards)
if rewards.Cmp(common.U2560) > 0 {
state.SetBalance(consensus.SystemAddress, balance.Sub(balance, rewards))
state.AddBalance(coinbase, rewards)
err := p.distributeToSystem(rewards.ToBig(), state, header, chain, txs, receipts, receivedTxs, usedGas, mining)
if err != nil {
return err
}
log.Trace("distribute to system reward pool", "block hash", header.Hash(), "amount", rewards)
balance = balance.Sub(balance, rewards)
}
}
log.Trace("distribute to validator contract", "block hash", header.Hash(), "amount", balance)
Expand Down

0 comments on commit e86af0b

Please sign in to comment.