// demoteUnexecutables removes invalid and processed transactions from the pools
// executable/pending queue and any subsequent transactions that become unexecutable
// are moved back into the future queue.
demoteUnexecutables removes invalid and processed transactions from the pools
executable/pending queue and any subsequent transactions that become unexecutable
are moved back into the future queue.
// demoteUnexecutables removes invalid and processed transactions from the pools // executable / pending queue and any subsequent transactions that become unexecutable // are moved back into the future queue .
func (nPool *NormalTxPool) DemoteUnexecutables() {
	for addr, list := range nPool.pending {
		for typ, txs := range list.txs {
			nonce := nPool.currentState.GetNonce(typ, addr)
			for _, tx := range txs.Forward(nonce) {
				nPool.deleteMap(tx)
				hash := tx.Hash()
				nPool.all.Remove(hash)
			}
			tBalance := new(big.Int)
			for _, tAccount := range nPool.currentState.GetBalance(typ, addr) {
				if tAccount.AccountType == common.MainAccount {
					tBalance = tAccount.Balance
					break
				}
			}
			drops, _ := list.Filter(tBalance, nPool.currentMaxGas, typ)
			for _, tx := range drops {
				nPool.deleteMap(tx)
				hash := tx.Hash()
				log.Trace("Removed unpayable pending transaction", "hash", hash)
				nPool.all.Remove(hash)
				pendingNofundsCounter.Inc(1)
			}
			if list.Empty(typ) {
				delete(nPool.pending[addr].txs, typ)
			}
		}
	}
}
func ( nPool * NormalTxPool ) DemoteUnexecutables ( ) { for addr , list := range nPool . pending { for typ , txs := range list . txs { nonce := nPool . currentState . GetNonce ( typ , addr ) for _ , tx := range txs . Forward ( nonce ) { nPool . deleteMap ( tx ) hash := tx . Hash ( ) nPool . all . Remove ( hash ) } tBalance := new ( big . Int ) for _ , tAccount := range nPool . currentState . GetBalance ( typ , addr ) { if tAccount . AccountType == common . MainAccount { tBalance = tAccount . Balance break } } drops , _ := list . Filter ( tBalance , nPool . currentMaxGas , typ ) for _ , tx := range drops { nPool . deleteMap ( tx ) hash := tx . Hash ( ) log . Trace ( " " , " " , hash ) nPool . all . Remove ( hash ) pendingNofundsCounter . Inc ( 1 ) } if list . Empty ( typ ) { delete ( nPool . pending [ addr ] . txs , typ ) } } } }
demoteUnexecutables removes invalid and processed transactions from the pools
executable/pending queue and any subsequent transactions that become unexecutable
are moved back into the future queue.
demoteUnexecutables removes invalid and processed transactions from the pools executable / pending queue and any subsequent transactions that become unexecutable are moved back into the future queue .
// Iterate over all accounts and demote any non-executable transactions // Drop all transactions that are deemed too old (low nonce) //log.Trace("Removed old pending transaction", "hash", hash) // Drop all transactions that are too costly (low balance or out of gas), and queue any invalids back for later // Delete the entire queue entry if it became empty.