class PhasingPollTable extends EntityDbTable<PhasingPoll> {

    public List<Transaction> getFinishingTransactions(int height) {
        Connection con = null;
        List<Transaction> transactions = new ArrayList<>();
        try {
            con = getDatabaseManager().getDataSource().getConnection();
            PreparedStatement pstmt = con.prepareStatement("SELECT transaction.* FROM transaction, phasing_poll " +
                "WHERE phasing_poll.id = transaction.id AND phasing_poll.finish_height = ? " +
                "ORDER BY transaction.height, transaction.transaction_index"); // ASC, not DESC
            pstmt.setInt(1, height);
            blockchain.getTransactions(con, pstmt).forEach(transactions::add);

            return transactions;
        } catch (SQLException e) {
            DbUtils.close(con);
            LOG.error(e.getMessage(), e);
            throw new RuntimeException(e);
        }
    }

    @Inject public  PhasingPollTable(Blockchain blockchain);

}