From d73d7ee8a4f252b6ff683036bade1b6c382c1d55 Mon Sep 17 00:00:00 2001 From: Jared Wasinger Date: Wed, 1 Dec 2021 00:30:10 +0000 Subject: [PATCH] consensus/ethash: move accumulation of coinbase witness before coinbase account is credited --- 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 8dd95be64c89..c393a9becf6d 100644 --- a/consensus/ethash/consensus.go +++ b/consensus/ethash/consensus.go @@ -667,7 +667,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) }