code: func (pool *TxPool) demoteUnexecutables() {
  	// Iterate over all accounts and demote any non-executable transactions
  	for addr, list := range pool.pending {
  		nonce := pool.currentState.GetNonce(addr)
  
  		// Drop all transactions that are deemed too old (low nonce)
  		for _, tx := range list.Forward(nonce) {
  			hash := tx.Hash()
  			log.Trace("Removed old pending transaction", "hash", hash)
  			pool.all.Remove(hash)
  			pool.priced.Removed()
  		}
  		// Drop all transactions that are too costly (low balance or out of gas), and queue any invalids back for later
  		drops, invalids := list.Filter(pool.currentState.GetBalance(addr), pool.currentMaxGas)
  		for _, tx := range drops {
  			hash := tx.Hash()
  			log.Trace("Removed unpayable pending transaction", "hash", hash)
  			pool.all.Remove(hash)
  			pool.priced.Removed()
  			pendingNofundsCounter.Inc(1)
  		}
  		for _, tx := range invalids {
  			hash := tx.Hash()
  			log.Trace("Demoting pending transaction", "hash", hash)
  			pool.enqueueTx(hash, tx)
  		}
  		// If there's a gap in front, alert (should never happen) and postpone all transactions
  		if list.Len() > 0 && list.txs.Get(nonce) == nil {
  			for _, tx := range list.Cap(0) {
  				hash := tx.Hash()
  				log.Error("Demoting invalidated transaction", "hash", hash)
  				pool.enqueueTx(hash, tx)
  			}
  		}
  		// Delete the entire queue entry if it became empty.
  		if list.Empty() {
  			delete(pool.pending, addr)
  			delete(pool.beats, addr)
  		}
  	}
  }
docs: // 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.