From 5bac5b326200c9e2aadd75a7360105c2539b7f77 Mon Sep 17 00:00:00 2001 From: jwasinger Date: Wed, 1 Dec 2021 22:41:11 -1000 Subject: [PATCH] consensus/ethash: move accumulation of coinbase witness before coinbase account is credited (#41) --- consensus/ethash/consensus.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/consensus/ethash/consensus.go b/consensus/ethash/consensus.go index 54726c589d86..91f2cf7ad73e 100644 --- a/consensus/ethash/consensus.go +++ b/consensus/ethash/consensus.go @@ -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) }