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
| 230 | // current state) and future transactions. Transactions move between those |
| 231 | // two states over time as they are received and processed. |
| 232 | type TxPool struct { |
| 233 | config TxPoolConfig |
| 234 | chainconfig *configs.ChainConfig |
| 235 | chain blockChain |
| 236 | gasPrice *big.Int |
| 237 | txFeed event.Feed |
| 238 | scope event.SubscriptionScope |
| 239 | chainHeadCh chan ChainHeadEvent |
| 240 | chainHeadSub event.Subscription |
| 241 | signer types.Signer |
| 242 | mu sync.RWMutex |
| 243 | |
| 244 | currentState *state.StateDB // Current state in the blockchain head |
| 245 | pendingState *state.ManagedState // Pending state tracking virtual nonces |
| 246 | currentMaxGas uint64 // Current gas limit for transaction caps |
| 247 | |
| 248 | locals *accountSet // Set of local transaction to exempt from eviction rules |
| 249 | journal *txJournal // Journal of local transaction to back up to disk |
| 250 | |
| 251 | pending map[common.Address]*txList // All currently processable transactions |
| 252 | queue map[common.Address]*txList // Queued but non-processable transactions |
| 253 | |
| 254 | beats map[common.Address]time.Time // Last heartbeat from each known account |
| 255 | all *txLookup // All transactions to allow lookups |
| 256 | priced *txPricedList // All transactions sorted by price |
| 257 | |
| 258 | wg sync.WaitGroup // for shutdown sync |
| 259 | } |
| 260 | |
| 261 | // setMapItem sets txlist of given addr, change it or add it |
| 262 | func setMapItem(m map[common.Address]*txList, addr common.Address, txlist *txList, maxSize uint64) bool { |
nothing calls this directly
no outgoing calls
no test coverage detected