consensus/ethash: move accumulation of coinbase witness before coinbase account is credited (#41)

This commit is contained in:
jwasinger
2021-12-01 22:41:11 -10:00
committed by GitHub
parent fa753db9e8
commit 5bac5b3262

View File

@ -669,7 +669,7 @@ func accumulateRewards(config *params.ChainConfig, state *state.StateDB, header
r.Div(blockReward, big32)
reward.Add(reward, r)
}
state.AddBalance(header.Coinbase, reward)
coinbase := utils.GetTreeKeyBalance(header.Coinbase.Bytes())
state.Witness().TouchAddress(coinbase, state.GetBalance(header.Coinbase).Bytes())
state.AddBalance(header.Coinbase, reward)
}