From 96ee6e15378b8367538b84c709d08fbfdafc9448 Mon Sep 17 00:00:00 2001
From: ledgerwatch <akhounov@gmail.com>
Date: Wed, 21 Jul 2021 19:35:08 +0100
Subject: [PATCH] Fix for eip1559 incorrect assert (#2415)

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
---
 core/state_transition.go | 1 +
 1 file changed, 1 insertion(+)

diff --git a/core/state_transition.go b/core/state_transition.go
index 92a5fd4de1..d7ae65e5b2 100644
--- a/core/state_transition.go
+++ b/core/state_transition.go
@@ -206,6 +206,7 @@ func (st *StateTransition) buyGas(gasBailout bool) error {
 		balanceCheck = st.sharedBuyGasBalance.SetUint64(st.msg.Gas())
 		balanceCheck = balanceCheck.Mul(balanceCheck, st.gasFeeCap)
 	}
+	balanceCheck.Add(balanceCheck, st.value)
 	if have, want := st.state.GetBalance(st.msg.From()), balanceCheck; have.Cmp(want) < 0 {
 		if !gasBailout {
 			return fmt.Errorf("%w: address %v have %v want %v", ErrInsufficientFunds, st.msg.From().Hex(), have, want)
-- 
GitLab