Skip to content

Commit

Permalink
add log
Browse files Browse the repository at this point in the history
  • Loading branch information
blxdyx committed Oct 11, 2024
1 parent 773a4e2 commit ec154c7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions consensus/parlia/parlia.go
Original file line number Diff line number Diff line change
Expand Up @@ -1417,10 +1417,10 @@ func (p *Parlia) distributeToSystem(val libcommon.Address, state *state.IntraBlo
txs *types.Transactions, receipts *types.Receipts, systemTxs *types.Transactions,
usedGas *uint64, mining bool, systemTxCall consensus.SystemTxCall, curIndex, txIndex *int) (bool, error) {
if *curIndex == *txIndex {
balance := state.GetBalance(consensus.SystemAddress).Clone()
if header.Number.Uint64() == 66 {
log.Info("")
log.Info("balance", balance.Uint64())
}
balance := state.GetBalance(consensus.SystemAddress).Clone()
if balance.Cmp(u256.Num0) <= 0 {
return false, nil
}
Expand All @@ -1429,6 +1429,9 @@ func (p *Parlia) distributeToSystem(val libcommon.Address, state *state.IntraBlo
if doDistributeSysReward {
rewards := new(uint256.Int)
rewards = rewards.Rsh(balance, systemRewardPercent)
if header.Number.Uint64() == 66 {
log.Info("rewards", rewards.Uint64())
}
state.SetBalance(consensus.SystemAddress, balance.Sub(balance, rewards), tracing.BalanceDecreaseGasBuy)
state.AddBalance(val, rewards, tracing.BalanceDecreaseGasBuy)
if rewards.Cmp(u256.Num0) > 0 {
Expand Down

0 comments on commit ec154c7

Please sign in to comment.