From d47ff53589b5f7352d4e2bd835c6d565a40fc66c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gast=C3=B3n=20Ponti?= Date: Tue, 26 Nov 2024 17:43:16 -0300 Subject: [PATCH] Fix retrieve FeeCurrency balance --- core/txpool/validation.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/txpool/validation.go b/core/txpool/validation.go index d173d4ce6c..1c2d0eb424 100644 --- a/core/txpool/validation.go +++ b/core/txpool/validation.go @@ -275,10 +275,13 @@ func ValidateTransactionWithState(tx *types.Transaction, signer types.Signer, op } // Ensure the transactor has enough funds to cover the transaction costs var ( - feeCurrencyBalance = opts.ExistingBalance(from, tx.FeeCurrency()) + feeCurrencyBalance = common.Big0 nativeBalance = opts.ExistingBalance(from, &common.ZeroAddress) feeCurrencyCost, nativeCost = tx.Cost() ) + if tx.FeeCurrency() != nil { + feeCurrencyBalance = opts.ExistingBalance(from, tx.FeeCurrency()) + } if feeCurrencyBalance == nil { return fmt.Errorf("feeCurrencyBalance is nil for FeeCurrency %x", tx.FeeCurrency()) }