/usr/include/bitcoin/primitives.hpp is in libbitcoin-dev 2.0-2.2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 | /*
* Copyright (c) 2011-2013 libbitcoin developers (see AUTHORS)
*
* This file is part of libbitcoin.
*
* libbitcoin is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License with
* additional permissions to the one published by the Free Software
* Foundation, either version 3 of the License, or (at your option)
* any later version. For more information see LICENSE.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LIBBITCOIN_PRIMITIVES_HPP
#define LIBBITCOIN_PRIMITIVES_HPP
#include <array>
#include <cstdint>
#include <string>
#include <vector>
#include <bitcoin/types.hpp>
#include <bitcoin/script.hpp>
namespace libbitcoin {
typedef std::vector<hash_digest> block_locator_type;
typedef std::array<uint8_t, 16> ip_address_type;
struct network_address_type
{
uint32_t timestamp;
uint64_t services;
ip_address_type ip;
uint16_t port;
};
enum class inventory_type_id
{
error,
transaction,
block,
none
};
struct inventory_vector_type
{
inventory_type_id type;
hash_digest hash;
};
typedef std::vector<inventory_vector_type> inventory_list;
struct header_type
{
uint32_t magic;
std::string command;
uint32_t payload_length;
// Ignored by version and verack commands
uint32_t checksum;
};
struct version_type
{
uint32_t version;
uint64_t services;
uint64_t timestamp;
network_address_type address_me;
network_address_type address_you;
uint64_t nonce;
std::string user_agent;
uint32_t start_height;
};
struct verack_type
{
};
struct get_address_type
{
};
struct get_blocks_type
{
// 10 sequential hashes, then exponential samples until reaching genesis
block_locator_type start_hashes;
hash_digest hash_stop;
};
struct output_point
{
hash_digest hash;
uint32_t index;
};
typedef output_point input_point;
typedef std::vector<input_point> input_point_list;
typedef std::vector<output_point> output_point_list;
struct transaction_input_type
{
output_point previous_output;
script_type script;
uint32_t sequence;
};
struct transaction_output_type
{
uint64_t value;
script_type script;
};
typedef std::vector<transaction_input_type> transaction_input_list;
typedef std::vector<transaction_output_type> transaction_output_list;
struct transaction_type
{
uint32_t version;
uint32_t locktime;
transaction_input_list inputs;
transaction_output_list outputs;
};
typedef std::vector<transaction_type> transaction_list;
struct block_header_type
{
uint32_t version;
hash_digest previous_block_hash;
hash_digest merkle;
uint32_t timestamp;
uint32_t bits;
uint32_t nonce;
};
struct block_type
{
block_header_type header;
transaction_list transactions;
};
typedef std::vector<network_address_type> network_address_list;
struct address_type
{
network_address_list addresses;
};
struct get_data_type
{
inventory_list inventories;
};
struct inventory_type
{
inventory_list inventories;
};
struct ping_type
{
uint64_t nonce;
};
struct pong_type
{
uint64_t nonce;
};
} // namespace libbitcoin
#endif
|