# core

TxPool

```
// TxPool contains all currently known transactions. Transactions
// enter the pool when they are received from the network or submitted
// locally. They exit the pool when they are included in the blockchain.
//
// The pool separates processable transactions (which can be applied to the
// current state) and future transactions. Transactions move between those
// two states over time as they are received and processed.
type TxPool struct {
    config       TxPoolConfig
    chainconfig  *params.ChainConfig
    chain        blockChain
    gasPrice     *big.Int
    txFeed       event.Feed
    scope        event.SubscriptionScope
    chainHeadCh  chan ChainHeadEvent
    chainHeadSub event.Subscription
    //abi       types.Signer
    mu sync.RWMutex

    currentState  *state.StateDB      // Current state in the blockchain head
    pendingState  *state.ManagedState // Pending state tracking virtual nonces
    currentMaxGas uint64              // Current gas limit for transaction caps

    locals *accountSet // Set of local transaction to exempt from eviction rules
    //journal *txJournal  // Journal of local transaction to back up to disk

    all        *txLookup     // All transactions to allow lookups
    priced     *txPricedList // All transactions sorted by priced
    newQueue   *txPricedList
    newPending *txPricedList
    beats      map[common.Hash]time.Time

    wg sync.WaitGroup // for shutdown sync

    homestead bool
}
```

TxPoolConfig

```
// TxPoolConfig are the configuration parameters of the transaction pool.
type TxPoolConfig struct {
    NoLocals bool // Whether local transaction handling should be disabled

    PriceLimit uint64 // Minimum gas priced to enforce for acceptance into the pool

    AccountSlots uint64 // Number of executable transaction slots guaranteed per account
    GlobalSlots  uint64 // Maximum number of executable transaction slots for all accounts
    AccountQueue uint64 // Maximum number of non-executable transaction slots permitted per account
    GlobalQueue  uint64 // Maximum number of non-executable transaction slots for all accounts

    Lifetime time.Duration // Maximum amount of time non-executable transaction are queued
}
```

accountSet

```
// accountSet is simply a set of addresses to check for existence, and a abi
// capable of deriving addresses from transactions.
type accountSet struct {
    accounts map[common.Address]struct{}
    //abi   types.Signer
}
```

txLookup

```
// txLookup is used internally by TxPool to track transactions while allowing lookup without
// mutex contention.
//
// Note, although this type is properly protected against concurrent access, it
// is **not** a type that should ever be mutated or even exposed outside of the
// transaction pool, since its internal state is tightly coupled with the pools
// internal mechanisms. The sole purpose of the type is to permit out-of-bound
// peeking into the pool in TxPool.Get without having to acquire the widely scoped
// TxPool.mu mutex.
type txLookup struct {
    all  map[common.Hash]*types.Transaction
    lock sync.RWMutex
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kelby.gitbook.io/super-zero-protocol-sero/qu-kuai-lian-ff08-nei-he-ff09/core.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
