mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 07:06:42 +00:00
core/txpool/legacypool: rename to checkDelegationLimit
This commit is contained in:
parent
7091d18045
commit
ebfcc3bccb
1 changed files with 6 additions and 4 deletions
|
|
@ -609,9 +609,11 @@ func (pool *LegacyPool) validateTx(tx *types.Transaction) error {
|
||||||
return pool.validateAuth(tx)
|
return pool.validateAuth(tx)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ensureDelegationLimit ensures the account with either delegation or pending
|
// checkDelegationLimit determines if the tx sender is delegated or has a
|
||||||
// delegation can at most send one inflight **executable** transaction.
|
// pending delegation, and if so, ensures they have at most one in-flight
|
||||||
func (pool *LegacyPool) ensureDelegationLimit(tx *types.Transaction) error {
|
// **executable** transaction, e.g. disallow stacked and gapped transactions
|
||||||
|
// from the account.
|
||||||
|
func (pool *LegacyPool) checkDelegationLimit(tx *types.Transaction) error {
|
||||||
from, _ := types.Sender(pool.signer, tx) // validated
|
from, _ := types.Sender(pool.signer, tx) // validated
|
||||||
|
|
||||||
// Short circuit if the sender has neither delegation nor pending delegation.
|
// Short circuit if the sender has neither delegation nor pending delegation.
|
||||||
|
|
@ -638,7 +640,7 @@ func (pool *LegacyPool) ensureDelegationLimit(tx *types.Transaction) error {
|
||||||
func (pool *LegacyPool) validateAuth(tx *types.Transaction) error {
|
func (pool *LegacyPool) validateAuth(tx *types.Transaction) error {
|
||||||
// Allow at most one in-flight tx for delegated accounts or those with a
|
// Allow at most one in-flight tx for delegated accounts or those with a
|
||||||
// pending authorization.
|
// pending authorization.
|
||||||
if err := pool.ensureDelegationLimit(tx); err != nil {
|
if err := pool.checkDelegationLimit(tx); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
// Authorities cannot conflict with any pending or queued transactions.
|
// Authorities cannot conflict with any pending or queued transactions.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue