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 {
618
618
from , _ := types .Sender (pool .signer , tx ) // validated
619
619
620
620
// 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 {
622
622
return nil
623
623
}
624
624
pending := pool .pending [from ]
@@ -1849,6 +1849,13 @@ func (t *lookup) removeAuthorities(tx *types.Transaction) {
1849
1849
}
1850
1850
}
1851
1851
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
+
1852
1859
// numSlots calculates the number of slots needed for a single transaction.
1853
1860
func numSlots (tx * types.Transaction ) int {
1854
1861
return int ((tx .Size () + txSlotSize - 1 ) / txSlotSize )
You can’t perform that action at this time.
0 commit comments