From e8e8e2f2e67dccf2a1daeca0b2d63fe28df9c71d Mon Sep 17 00:00:00 2001 From: Alex Sharov Date: Fri, 18 Mar 2022 03:16:57 +0700 Subject: [PATCH] Pool cost (#373) * save * save --- txpool/pool.go | 2 +- txpool/pool_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/txpool/pool.go b/txpool/pool.go index 185a588b6..e49b78279 100644 --- a/txpool/pool.go +++ b/txpool/pool.go @@ -685,7 +685,7 @@ func (p *TxPool) validateTx(txn *TxSlot, isLocal bool, stateCache kvcache.CacheV } // Transactor should have enough funds to cover the costs total := uint256.NewInt(txn.gas) - total.Mul(total, uint256.NewInt(txn.tip)) + total.Mul(total, uint256.NewInt(txn.feeCap)) total.Add(total, &txn.value) if senderBalance.Cmp(total) < 0 { if txn.traced { diff --git a/txpool/pool_test.go b/txpool/pool_test.go index d07e027c7..cad5e532a 100644 --- a/txpool/pool_test.go +++ b/txpool/pool_test.go @@ -176,8 +176,8 @@ func TestNonceFromAddress(t *testing.T) { { var txSlots TxSlots txSlot1 := &TxSlot{ - tip: 9 * common.Ether, - feeCap: 300000, + tip: 300000, + feeCap: 9 * common.Ether, gas: 100000, nonce: 3, }