// Pending retrieves all currently processable transactions, groupped by origin
// account and sorted by nonce. The returned transaction set is a copy and can be
// freely modified by calling code.
Pending retrieves all currently processable transactions, groupped by origin
account and sorted by nonce. The returned transaction set is a copy and can be
freely modified by calling code.
// Pending retrieves all currently processable transactions groupped by origin // account and sorted by nonce . The returned transaction set is a copy and can be // freely modified by calling code .
func (nPool *NormalTxPool) Pending() (map[string]map[common.Address]types.SelfTransactions, error) {
	nPool.mu.Lock()
	defer nPool.mu.Unlock()
	count := 0
	pending := make(map[string]map[common.Address]types.SelfTransactions)
	for addr, list := range nPool.pending {
		for coin, txs := range list.txs {
			txlist := make([]*types.Transaction, 0)
			txlist = txs.Flatten()
			txsmap := pending[coin]
			if txsmap == nil {
				txsmap = make(map[common.Address]types.SelfTransactions)
			}
			for _, tx := range txlist {
				if len(tx.N) <= 0 {
					continue
				}
				nPool.NContainer[tx.N[0]] = tx
				txsmap[addr] = append(txsmap[addr], tx)
				count++
			}
			pending[coin] = txsmap
		}
	}
	log.Trace("txpool", "Pending txpool tx count", count, "len(pending)", len(pending[params.MAN_COIN]))
	return pending, nil
}
func ( nPool * NormalTxPool ) Pending ( ) ( map [ string ] map [ common . Address ] types . SelfTransactions , error ) { nPool . mu . Lock ( ) defer nPool . mu . Unlock ( ) count := 0 pending := make ( map [ string ] map [ common . Address ] types . SelfTransactions ) for addr , list := range nPool . pending { for coin , txs := range list . txs { txlist := make ( [ ] * types . Transaction , 0 ) txlist = txs . Flatten ( ) txsmap := pending [ coin ] if txsmap == nil { txsmap = make ( map [ common . Address ] types . SelfTransactions ) } for _ , tx := range txlist { if len ( tx . N ) <= 0 { continue } nPool . NContainer [ tx . N [ 0 ] ] = tx txsmap [ addr ] = append ( txsmap [ addr ] , tx ) count ++ } pending [ coin ] = txsmap } } log . Trace ( " " , " " , count , " " , len ( pending [ params . MAN_COIN ] ) ) return pending , nil }
Pending retrieves all currently processable transactions, groupped by origin
account and sorted by nonce.
Pending retrieves all currently processable transactions groupped by origin account and sorted by nonce .