|
| 1 | +/** |
| 2 | + * Copyright (c) 2011-2025 libbitcoin developers (see AUTHORS) |
| 3 | + * |
| 4 | + * This file is part of libbitcoin. |
| 5 | + * |
| 6 | + * This program is free software: you can redistribute it and/or modify |
| 7 | + * it under the terms of the GNU Affero General Public License as published by |
| 8 | + * the Free Software Foundation, either version 3 of the License, or |
| 9 | + * (at your option) any later version. |
| 10 | + * |
| 11 | + * This program is distributed in the hope that it will be useful, |
| 12 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | + * GNU Affero General Public License for more details. |
| 15 | + * |
| 16 | + * You should have received a copy of the GNU Affero General Public License |
| 17 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 18 | + */ |
| 19 | +#ifndef LIBBITCOIN_DATABASE_TYPES_HPP |
| 20 | +#define LIBBITCOIN_DATABASE_TYPES_HPP |
| 21 | + |
| 22 | +#include <set> |
| 23 | +#include <utility> |
| 24 | +#include <bitcoin/database/define.hpp> |
| 25 | +#include <bitcoin/database/tables/tables.hpp> |
| 26 | + |
| 27 | +namespace libbitcoin { |
| 28 | +namespace database { |
| 29 | + |
| 30 | +/// Database type aliases. |
| 31 | +using height_link = table::height::link; |
| 32 | +using header_link = table::header::link; |
| 33 | +using output_link = table::output::link; |
| 34 | +using input_link = table::input::link; |
| 35 | +using outs_link = table::outs::link; |
| 36 | +using ins_link = table::ins::link; |
| 37 | +using point_link = table::point::link; |
| 38 | +using tx_link = table::transaction::link; |
| 39 | +using filter_link = table::filter_tx::link; |
| 40 | +using strong_link = table::strong_tx::link; |
| 41 | + |
| 42 | +using header_links = std::vector<header_link::integer>; |
| 43 | +using tx_links = std::vector<tx_link::integer>; |
| 44 | +using input_links = std::vector<input_link::integer>; |
| 45 | +using output_links = std::vector<output_link::integer>; |
| 46 | +using point_links = std::vector<point_link::integer>; |
| 47 | +using two_counts = std::pair<size_t, size_t>; |
| 48 | +using point_key = table::point::key; |
| 49 | + |
| 50 | +struct header_state{ header_link link; code ec; }; |
| 51 | +using header_states = std::vector<header_state>; |
| 52 | + |
| 53 | +// TODO: define a system::chain::inpoint with added state. |
| 54 | +using inpoint = system::chain::point; |
| 55 | +using inpoints = std::set<inpoint>; |
| 56 | +using outpoint = system::chain::outpoint; |
| 57 | +using outpoints = std::set<outpoint>; |
| 58 | + |
| 59 | +} // namespace database |
| 60 | +} // namespace libbitcoin |
| 61 | + |
| 62 | +#endif |
0 commit comments