mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-11 14:33:52 +00:00
feat(txpool): use GasFeeCapIntCmp to check min fee (#901)
* feat(txpool): use GasFeeCapIntCmp to check min fee * fix test
This commit is contained in:
parent
55f70cc6e8
commit
0b5146bdef
3 changed files with 3 additions and 3 deletions
|
|
@ -682,7 +682,7 @@ func (pool *TxPool) validateTx(tx *types.Transaction, local bool) error {
|
||||||
return ErrInvalidSender
|
return ErrInvalidSender
|
||||||
}
|
}
|
||||||
// Drop non-local transactions under our own minimal accepted gas price or tip.
|
// Drop non-local transactions under our own minimal accepted gas price or tip.
|
||||||
if !local && tx.GasTipCapIntCmp(pool.gasPrice) < 0 {
|
if !local && tx.GasFeeCapIntCmp(pool.gasPrice) < 0 {
|
||||||
return ErrUnderpriced
|
return ErrUnderpriced
|
||||||
}
|
}
|
||||||
// Ensure the transaction adheres to nonce ordering
|
// Ensure the transaction adheres to nonce ordering
|
||||||
|
|
|
||||||
|
|
@ -1534,7 +1534,7 @@ func TestTransactionPoolRepricingDynamicFee(t *testing.T) {
|
||||||
if err := pool.AddRemote(tx); err != ErrUnderpriced {
|
if err := pool.AddRemote(tx); err != ErrUnderpriced {
|
||||||
t.Fatalf("adding underpriced pending transaction error mismatch: have %v, want %v", err, ErrUnderpriced)
|
t.Fatalf("adding underpriced pending transaction error mismatch: have %v, want %v", err, ErrUnderpriced)
|
||||||
}
|
}
|
||||||
tx = dynamicFeeTx(0, 100000, big.NewInt(2), big.NewInt(1), keys[1])
|
tx = dynamicFeeTx(0, 100000, big.NewInt(1), big.NewInt(1), keys[1])
|
||||||
if err := pool.AddRemote(tx); err != ErrUnderpriced {
|
if err := pool.AddRemote(tx); err != ErrUnderpriced {
|
||||||
t.Fatalf("adding underpriced pending transaction error mismatch: have %v, want %v", err, ErrUnderpriced)
|
t.Fatalf("adding underpriced pending transaction error mismatch: have %v, want %v", err, ErrUnderpriced)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ import (
|
||||||
const (
|
const (
|
||||||
VersionMajor = 5 // Major version component of the current release
|
VersionMajor = 5 // Major version component of the current release
|
||||||
VersionMinor = 5 // Minor version component of the current release
|
VersionMinor = 5 // Minor version component of the current release
|
||||||
VersionPatch = 9 // Patch version component of the current release
|
VersionPatch = 10 // Patch version component of the current release
|
||||||
VersionMeta = "mainnet" // Version metadata to append to the version string
|
VersionMeta = "mainnet" // Version metadata to append to the version string
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue