File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -618,7 +618,7 @@ func (pool *LegacyPool) checkDelegationLimit(tx *types.Transaction) error {
618618 from , _ := types .Sender (pool .signer , tx ) // validated
619619
620620 // Short circuit if the sender has neither delegation nor pending delegation.
621- if pool .currentState .GetCodeHash (from ) == types .EmptyCodeHash && len ( pool .all .auths [ from ] ) == 0 {
621+ if pool .currentState .GetCodeHash (from ) == types .EmptyCodeHash && pool .all .delegationTxsCount ( from ) == 0 {
622622 return nil
623623 }
624624 pending := pool .pending [from ]
@@ -1849,6 +1849,13 @@ func (t *lookup) removeAuthorities(tx *types.Transaction) {
18491849 }
18501850}
18511851
1852+ // delegationTxsCount returns the number of pending authorizations for the specified address.
1853+ func (t * lookup ) delegationTxsCount (addr common.Address ) int {
1854+ t .lock .RLock ()
1855+ defer t .lock .RUnlock ()
1856+ return len (t .auths [addr ])
1857+ }
1858+
18521859// numSlots calculates the number of slots needed for a single transaction.
18531860func numSlots (tx * types.Transaction ) int {
18541861 return int ((tx .Size () + txSlotSize - 1 ) / txSlotSize )
You can’t perform that action at this time.
0 commit comments