mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-12 15:03:45 +00:00
fix withdraw balance change name
This commit is contained in:
parent
c3319301cc
commit
626fee4fed
3 changed files with 3 additions and 3 deletions
|
|
@ -325,7 +325,7 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
|
||||||
for _, w := range pre.Env.Withdrawals {
|
for _, w := range pre.Env.Withdrawals {
|
||||||
// Amount is in gwei, turn into wei
|
// Amount is in gwei, turn into wei
|
||||||
amount := new(big.Int).Mul(new(big.Int).SetUint64(w.Amount), big.NewInt(params.GWei))
|
amount := new(big.Int).Mul(new(big.Int).SetUint64(w.Amount), big.NewInt(params.GWei))
|
||||||
statedb.AddBalance(w.Address, amount, state.BalanceChangeWithdrawal)
|
statedb.AddBalance(w.Address, amount, state.BalanceIncreaseWithdrawal)
|
||||||
}
|
}
|
||||||
// Commit block
|
// Commit block
|
||||||
root, err := statedb.Commit(vmContext.BlockNumber.Uint64(), chainConfig.IsEIP158(vmContext.BlockNumber))
|
root, err := statedb.Commit(vmContext.BlockNumber.Uint64(), chainConfig.IsEIP158(vmContext.BlockNumber))
|
||||||
|
|
|
||||||
|
|
@ -357,7 +357,7 @@ func (beacon *Beacon) Finalize(chain consensus.ChainHeaderReader, header *types.
|
||||||
// Convert amount from gwei to wei.
|
// Convert amount from gwei to wei.
|
||||||
amount := new(big.Int).SetUint64(w.Amount)
|
amount := new(big.Int).SetUint64(w.Amount)
|
||||||
amount = amount.Mul(amount, big.NewInt(params.GWei))
|
amount = amount.Mul(amount, big.NewInt(params.GWei))
|
||||||
stateDB.AddBalance(w.Address, amount, state.BalanceChangeWithdrawal)
|
stateDB.AddBalance(w.Address, amount, state.BalanceIncreaseWithdrawal)
|
||||||
}
|
}
|
||||||
// No block reward which is issued by consensus layer instead.
|
// No block reward which is issued by consensus layer instead.
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ const (
|
||||||
// BalanceIncreaseRewardMineBlock is a reward for mining a block.
|
// BalanceIncreaseRewardMineBlock is a reward for mining a block.
|
||||||
BalanceIncreaseRewardMineBlock BalanceChangeReason = 2
|
BalanceIncreaseRewardMineBlock BalanceChangeReason = 2
|
||||||
// BalanceIncreaseWithdrawal is ether withdrawn from the beacon chain.
|
// BalanceIncreaseWithdrawal is ether withdrawn from the beacon chain.
|
||||||
BalanceChangeWithdrawal BalanceChangeReason = 3
|
BalanceIncreaseWithdrawal BalanceChangeReason = 3
|
||||||
// BalanceIncreaseGenesisBalance is ether allocated at the genesis block.
|
// BalanceIncreaseGenesisBalance is ether allocated at the genesis block.
|
||||||
BalanceIncreaseGenesisBalance BalanceChangeReason = 4
|
BalanceIncreaseGenesisBalance BalanceChangeReason = 4
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue