Electroneum
Toggle main menu visibility
Loading...
Searching...
No Matches
message_data_structs.h
Go to the documentation of this file.
1
// Copyright (c) 2016-2019, The Monero Project
2
//
3
// All rights reserved.
4
//
5
// Redistribution and use in source and binary forms, with or without modification, are
6
// permitted provided that the following conditions are met:
7
//
8
// 1. Redistributions of source code must retain the above copyright notice, this list of
9
// conditions and the following disclaimer.
10
//
11
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
12
// of conditions and the following disclaimer in the documentation and/or other
13
// materials provided with the distribution.
14
//
15
// 3. Neither the name of the copyright holder nor the names of its contributors may be
16
// used to endorse or promote products derived from this software without specific
17
// prior written permission.
18
//
19
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
20
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
22
// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
27
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
29
#pragma once
30
31
#include "
crypto/hash.h
"
32
#include "
cryptonote_basic/cryptonote_basic.h
"
33
#include "
cryptonote_basic/difficulty.h
"
34
#include "
ringct/rctSigs.h
"
35
#include "
rpc/rpc_handler.h
"
36
37
#include <unordered_map>
38
#include <vector>
39
40
namespace
cryptonote
41
{
42
43
namespace
rpc
44
{
45
46
struct
block_with_transactions
47
{
48
cryptonote::block
block
;
49
std::vector<cryptonote::transaction>
transactions
;
50
};
51
52
typedef
std::vector<uint64_t>
tx_output_indices
;
53
54
typedef
std::vector<tx_output_indices>
block_output_indices
;
55
56
struct
transaction_info
57
{
58
cryptonote::transaction
transaction
;
59
bool
in_pool
;
60
uint64_t
height
;
61
};
62
63
struct
output_key_and_amount_index
64
{
65
uint64_t
amount_index
;
66
crypto::public_key
key
;
67
};
68
69
typedef
std::vector<output_key_and_amount_index>
outputs_for_amount
;
70
71
struct
amount_with_random_outputs
72
{
73
uint64_t
amount
;
74
outputs_for_amount
outputs
;
75
};
76
77
struct
peer
78
{
79
uint64_t
id
;
80
uint32_t
ip
;
81
uint16_t
port
;
82
uint16_t
rpc_port
;
83
uint64_t
last_seen
;
84
uint32_t
pruning_seed
;
85
};
86
87
struct
tx_in_pool
88
{
89
cryptonote::transaction
tx
;
90
crypto::hash
tx_hash
;
91
uint64_t
blob_size
;
92
uint64_t
weight
;
93
uint64_t
fee
;
94
crypto::hash
max_used_block_hash
;
95
uint64_t
max_used_block_height
;
96
bool
kept_by_block
;
97
crypto::hash
last_failed_block_hash
;
98
uint64_t
last_failed_block_height
;
99
uint64_t
receive_time
;
100
uint64_t
last_relayed_time
;
101
bool
relayed
;
102
bool
do_not_relay
;
103
bool
double_spend_seen
;
104
bool
nonexistent_utxo_seen
;
105
};
106
107
typedef
std::unordered_map<crypto::key_image, std::vector<crypto::hash> >
key_images_with_tx_hashes
;
108
109
struct
output_amount_count
110
{
111
uint64_t
amount
;
112
uint64_t
total_count
;
113
uint64_t
unlocked_count
;
114
uint64_t
recent_count
;
115
};
116
117
struct
output_amount_and_index
118
{
119
uint64_t
amount
;
120
uint64_t
index
;
121
};
122
123
struct
output_key_mask_unlocked
124
{
125
crypto::public_key
key
;
126
rct::key
mask
;
127
bool
unlocked
;
128
};
129
130
struct
hard_fork_info
131
{
132
uint8_t
version
;
133
bool
enabled
;
134
uint32_t
window
;
135
uint32_t
votes
;
136
uint32_t
threshold
;
137
uint8_t
voting
;
138
uint32_t
state
;
139
uint64_t
earliest_height
;
140
};
141
142
//required by JSON-RPC 2.0 spec
143
struct
error
144
{
145
// not really using code, maybe later.
146
error
() :
use
(
false
),
code
(1) { }
147
148
bool
use
;
// do not serialize
149
150
int32_t
code
;
151
152
// not required by spec, but int error codes aren't perfect
153
std::string
error_str
;
154
155
std::string
message
;
156
157
//TODO: data member? not required, may want later.
158
};
159
160
struct
BlockHeaderResponse
161
{
162
uint64_t
major_version
;
163
uint64_t
minor_version
;
164
uint64_t
timestamp
;
165
crypto::hash
prev_id
;
166
uint32_t
nonce
;
167
uint64_t
height
;
168
uint64_t
depth
;
169
crypto::hash
hash
;
170
cryptonote::difficulty_type
wide_difficulty
;
171
uint64_t
difficulty
;
172
uint64_t
reward
;
173
};
174
175
struct
DaemonInfo
176
{
177
uint64_t
height
;
178
uint64_t
target_height
;
179
cryptonote::difficulty_type
wide_difficulty
;
180
uint64_t
difficulty
;
181
uint64_t
target
;
182
uint64_t
tx_count
;
183
uint64_t
tx_pool_size
;
184
uint64_t
alt_blocks_count
;
185
uint64_t
outgoing_connections_count
;
186
uint64_t
incoming_connections_count
;
187
uint64_t
white_peerlist_size
;
188
uint64_t
grey_peerlist_size
;
189
bool
mainnet
;
190
bool
testnet
;
191
bool
stagenet
;
192
std::string
nettype
;
193
crypto::hash
top_block_hash
;
194
cryptonote::difficulty_type
wide_cumulative_difficulty
;
195
uint64_t
cumulative_difficulty
;
196
uint64_t
block_size_limit
;
197
uint64_t
block_weight_limit
;
198
uint64_t
block_size_median
;
199
uint64_t
block_weight_median
;
200
uint64_t
start_time
;
201
std::string
version
;
202
};
203
204
struct
output_distribution
205
{
206
output_distribution_data
data
;
207
uint64_t
amount
;
208
bool
cumulative
;
209
};
210
}
// namespace rpc
211
212
}
// namespace cryptonote
cryptonote::transaction
Definition
cryptonote_basic.h:298
cryptonote_basic.h
difficulty.h
crypto::public_key
POD_CLASS public_key
Definition
crypto.h:79
crypto::hash
POD_CLASS hash
Definition
hash.h:50
cryptonote::rpc
Definition
daemon_handler.cpp:43
cryptonote::rpc::outputs_for_amount
std::vector< output_key_and_amount_index > outputs_for_amount
Definition
message_data_structs.h:69
cryptonote::rpc::key_images_with_tx_hashes
std::unordered_map< crypto::key_image, std::vector< crypto::hash > > key_images_with_tx_hashes
Definition
message_data_structs.h:107
cryptonote::rpc::block_output_indices
std::vector< tx_output_indices > block_output_indices
Definition
message_data_structs.h:54
cryptonote::rpc::tx_output_indices
std::vector< uint64_t > tx_output_indices
Definition
message_data_structs.h:52
cryptonote
Holds cryptonote related classes and helpers.
Definition
ban.cpp:40
cryptonote::difficulty_type
boost::multiprecision::uint128_t difficulty_type
Definition
difficulty.h:43
rctSigs.h
rpc_handler.h
hash.h
false
#define false
uint16_t
unsigned short uint16_t
Definition
stdint.h:125
uint32_t
unsigned int uint32_t
Definition
stdint.h:126
int32_t
signed int int32_t
Definition
stdint.h:123
uint8_t
unsigned char uint8_t
Definition
stdint.h:124
uint64_t
unsigned __int64 uint64_t
Definition
stdint.h:136
cryptonote::block
Definition
cryptonote_basic.h:464
cryptonote::rpc::BlockHeaderResponse
Definition
message_data_structs.h:161
cryptonote::rpc::BlockHeaderResponse::hash
crypto::hash hash
Definition
message_data_structs.h:169
cryptonote::rpc::BlockHeaderResponse::prev_id
crypto::hash prev_id
Definition
message_data_structs.h:165
cryptonote::rpc::BlockHeaderResponse::nonce
uint32_t nonce
Definition
message_data_structs.h:166
cryptonote::rpc::BlockHeaderResponse::depth
uint64_t depth
Definition
message_data_structs.h:168
cryptonote::rpc::BlockHeaderResponse::wide_difficulty
cryptonote::difficulty_type wide_difficulty
Definition
message_data_structs.h:170
cryptonote::rpc::BlockHeaderResponse::height
uint64_t height
Definition
message_data_structs.h:167
cryptonote::rpc::BlockHeaderResponse::major_version
uint64_t major_version
Definition
message_data_structs.h:162
cryptonote::rpc::BlockHeaderResponse::timestamp
uint64_t timestamp
Definition
message_data_structs.h:164
cryptonote::rpc::BlockHeaderResponse::minor_version
uint64_t minor_version
Definition
message_data_structs.h:163
cryptonote::rpc::BlockHeaderResponse::reward
uint64_t reward
Definition
message_data_structs.h:172
cryptonote::rpc::BlockHeaderResponse::difficulty
uint64_t difficulty
Definition
message_data_structs.h:171
cryptonote::rpc::DaemonInfo
Definition
message_data_structs.h:176
cryptonote::rpc::DaemonInfo::target_height
uint64_t target_height
Definition
message_data_structs.h:178
cryptonote::rpc::DaemonInfo::grey_peerlist_size
uint64_t grey_peerlist_size
Definition
message_data_structs.h:188
cryptonote::rpc::DaemonInfo::target
uint64_t target
Definition
message_data_structs.h:181
cryptonote::rpc::DaemonInfo::block_size_median
uint64_t block_size_median
Definition
message_data_structs.h:198
cryptonote::rpc::DaemonInfo::wide_difficulty
cryptonote::difficulty_type wide_difficulty
Definition
message_data_structs.h:179
cryptonote::rpc::DaemonInfo::alt_blocks_count
uint64_t alt_blocks_count
Definition
message_data_structs.h:184
cryptonote::rpc::DaemonInfo::top_block_hash
crypto::hash top_block_hash
Definition
message_data_structs.h:193
cryptonote::rpc::DaemonInfo::tx_count
uint64_t tx_count
Definition
message_data_structs.h:182
cryptonote::rpc::DaemonInfo::wide_cumulative_difficulty
cryptonote::difficulty_type wide_cumulative_difficulty
Definition
message_data_structs.h:194
cryptonote::rpc::DaemonInfo::block_size_limit
uint64_t block_size_limit
Definition
message_data_structs.h:196
cryptonote::rpc::DaemonInfo::cumulative_difficulty
uint64_t cumulative_difficulty
Definition
message_data_structs.h:195
cryptonote::rpc::DaemonInfo::incoming_connections_count
uint64_t incoming_connections_count
Definition
message_data_structs.h:186
cryptonote::rpc::DaemonInfo::difficulty
uint64_t difficulty
Definition
message_data_structs.h:180
cryptonote::rpc::DaemonInfo::block_weight_limit
uint64_t block_weight_limit
Definition
message_data_structs.h:197
cryptonote::rpc::DaemonInfo::outgoing_connections_count
uint64_t outgoing_connections_count
Definition
message_data_structs.h:185
cryptonote::rpc::DaemonInfo::stagenet
bool stagenet
Definition
message_data_structs.h:191
cryptonote::rpc::DaemonInfo::start_time
uint64_t start_time
Definition
message_data_structs.h:200
cryptonote::rpc::DaemonInfo::version
std::string version
Definition
message_data_structs.h:201
cryptonote::rpc::DaemonInfo::nettype
std::string nettype
Definition
message_data_structs.h:192
cryptonote::rpc::DaemonInfo::white_peerlist_size
uint64_t white_peerlist_size
Definition
message_data_structs.h:187
cryptonote::rpc::DaemonInfo::block_weight_median
uint64_t block_weight_median
Definition
message_data_structs.h:199
cryptonote::rpc::DaemonInfo::mainnet
bool mainnet
Definition
message_data_structs.h:189
cryptonote::rpc::DaemonInfo::height
uint64_t height
Definition
message_data_structs.h:177
cryptonote::rpc::DaemonInfo::testnet
bool testnet
Definition
message_data_structs.h:190
cryptonote::rpc::DaemonInfo::tx_pool_size
uint64_t tx_pool_size
Definition
message_data_structs.h:183
cryptonote::rpc::amount_with_random_outputs
Definition
message_data_structs.h:72
cryptonote::rpc::amount_with_random_outputs::outputs
outputs_for_amount outputs
Definition
message_data_structs.h:74
cryptonote::rpc::amount_with_random_outputs::amount
uint64_t amount
Definition
message_data_structs.h:73
cryptonote::rpc::block_with_transactions
Definition
message_data_structs.h:47
cryptonote::rpc::block_with_transactions::transactions
std::vector< cryptonote::transaction > transactions
Definition
message_data_structs.h:49
cryptonote::rpc::block_with_transactions::block
cryptonote::block block
Definition
message_data_structs.h:48
cryptonote::rpc::error::message
std::string message
Definition
message_data_structs.h:155
cryptonote::rpc::error::code
int32_t code
Definition
message_data_structs.h:150
cryptonote::rpc::error::error
error()
Definition
message_data_structs.h:146
cryptonote::rpc::error::use
bool use
Definition
message_data_structs.h:148
cryptonote::rpc::error::error_str
std::string error_str
Definition
message_data_structs.h:153
cryptonote::rpc::hard_fork_info
Definition
message_data_structs.h:131
cryptonote::rpc::hard_fork_info::threshold
uint32_t threshold
Definition
message_data_structs.h:136
cryptonote::rpc::hard_fork_info::votes
uint32_t votes
Definition
message_data_structs.h:135
cryptonote::rpc::hard_fork_info::earliest_height
uint64_t earliest_height
Definition
message_data_structs.h:139
cryptonote::rpc::hard_fork_info::voting
uint8_t voting
Definition
message_data_structs.h:137
cryptonote::rpc::hard_fork_info::state
uint32_t state
Definition
message_data_structs.h:138
cryptonote::rpc::hard_fork_info::version
uint8_t version
Definition
message_data_structs.h:132
cryptonote::rpc::hard_fork_info::enabled
bool enabled
Definition
message_data_structs.h:133
cryptonote::rpc::hard_fork_info::window
uint32_t window
Definition
message_data_structs.h:134
cryptonote::rpc::output_amount_and_index
Definition
message_data_structs.h:118
cryptonote::rpc::output_amount_and_index::amount
uint64_t amount
Definition
message_data_structs.h:119
cryptonote::rpc::output_amount_and_index::index
uint64_t index
Definition
message_data_structs.h:120
cryptonote::rpc::output_amount_count
Definition
message_data_structs.h:110
cryptonote::rpc::output_amount_count::recent_count
uint64_t recent_count
Definition
message_data_structs.h:114
cryptonote::rpc::output_amount_count::total_count
uint64_t total_count
Definition
message_data_structs.h:112
cryptonote::rpc::output_amount_count::amount
uint64_t amount
Definition
message_data_structs.h:111
cryptonote::rpc::output_amount_count::unlocked_count
uint64_t unlocked_count
Definition
message_data_structs.h:113
cryptonote::rpc::output_distribution_data
Definition
rpc_handler.h:45
cryptonote::rpc::output_distribution
Definition
message_data_structs.h:205
cryptonote::rpc::output_distribution::cumulative
bool cumulative
Definition
message_data_structs.h:208
cryptonote::rpc::output_distribution::data
output_distribution_data data
Definition
message_data_structs.h:206
cryptonote::rpc::output_distribution::amount
uint64_t amount
Definition
message_data_structs.h:207
cryptonote::rpc::output_key_and_amount_index
Definition
message_data_structs.h:64
cryptonote::rpc::output_key_and_amount_index::key
crypto::public_key key
Definition
message_data_structs.h:66
cryptonote::rpc::output_key_and_amount_index::amount_index
uint64_t amount_index
Definition
message_data_structs.h:65
cryptonote::rpc::output_key_mask_unlocked
Definition
message_data_structs.h:124
cryptonote::rpc::output_key_mask_unlocked::mask
rct::key mask
Definition
message_data_structs.h:126
cryptonote::rpc::output_key_mask_unlocked::unlocked
bool unlocked
Definition
message_data_structs.h:127
cryptonote::rpc::output_key_mask_unlocked::key
crypto::public_key key
Definition
message_data_structs.h:125
cryptonote::rpc::peer
Definition
message_data_structs.h:78
cryptonote::rpc::peer::last_seen
uint64_t last_seen
Definition
message_data_structs.h:83
cryptonote::rpc::peer::rpc_port
uint16_t rpc_port
Definition
message_data_structs.h:82
cryptonote::rpc::peer::id
uint64_t id
Definition
message_data_structs.h:79
cryptonote::rpc::peer::port
uint16_t port
Definition
message_data_structs.h:81
cryptonote::rpc::peer::ip
uint32_t ip
Definition
message_data_structs.h:80
cryptonote::rpc::peer::pruning_seed
uint32_t pruning_seed
Definition
message_data_structs.h:84
cryptonote::rpc::transaction_info
Definition
message_data_structs.h:57
cryptonote::rpc::transaction_info::height
uint64_t height
Definition
message_data_structs.h:60
cryptonote::rpc::transaction_info::transaction
cryptonote::transaction transaction
Definition
message_data_structs.h:58
cryptonote::rpc::transaction_info::in_pool
bool in_pool
Definition
message_data_structs.h:59
cryptonote::rpc::tx_in_pool
Definition
message_data_structs.h:88
cryptonote::rpc::tx_in_pool::blob_size
uint64_t blob_size
Definition
message_data_structs.h:91
cryptonote::rpc::tx_in_pool::fee
uint64_t fee
Definition
message_data_structs.h:93
cryptonote::rpc::tx_in_pool::kept_by_block
bool kept_by_block
Definition
message_data_structs.h:96
cryptonote::rpc::tx_in_pool::weight
uint64_t weight
Definition
message_data_structs.h:92
cryptonote::rpc::tx_in_pool::last_failed_block_hash
crypto::hash last_failed_block_hash
Definition
message_data_structs.h:97
cryptonote::rpc::tx_in_pool::tx
cryptonote::transaction tx
Definition
message_data_structs.h:89
cryptonote::rpc::tx_in_pool::last_relayed_time
uint64_t last_relayed_time
Definition
message_data_structs.h:100
cryptonote::rpc::tx_in_pool::tx_hash
crypto::hash tx_hash
Definition
message_data_structs.h:90
cryptonote::rpc::tx_in_pool::relayed
bool relayed
Definition
message_data_structs.h:101
cryptonote::rpc::tx_in_pool::receive_time
uint64_t receive_time
Definition
message_data_structs.h:99
cryptonote::rpc::tx_in_pool::nonexistent_utxo_seen
bool nonexistent_utxo_seen
Definition
message_data_structs.h:104
cryptonote::rpc::tx_in_pool::last_failed_block_height
uint64_t last_failed_block_height
Definition
message_data_structs.h:98
cryptonote::rpc::tx_in_pool::max_used_block_height
uint64_t max_used_block_height
Definition
message_data_structs.h:95
cryptonote::rpc::tx_in_pool::max_used_block_hash
crypto::hash max_used_block_hash
Definition
message_data_structs.h:94
cryptonote::rpc::tx_in_pool::double_spend_seen
bool double_spend_seen
Definition
message_data_structs.h:103
cryptonote::rpc::tx_in_pool::do_not_relay
bool do_not_relay
Definition
message_data_structs.h:102
rct::key
Definition
rctTypes.h:78
src
rpc
message_data_structs.h
Generated on
for Electroneum by
1.17.0