MCPcopy Create free account
hub / github.com/CPChain/chain / TxPool

Struct TxPool

core/tx_pool.go:232–259  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

230// current state) and future transactions. Transactions move between those
231// two states over time as they are received and processed.
232type 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
262func setMapItem(m map[common.Address]*txList, addr common.Address, txlist *txList, maxSize uint64) bool {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected