Monero
message_data_structs.h
Go to the documentation of this file.
1 // Copyright (c) 2016-2022, 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"
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 
47  {
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 
57  {
59  bool in_pool;
61  };
62 
64  {
67  };
68 
69  typedef std::vector<output_key_and_amount_index> outputs_for_amount;
70 
72  {
75  };
76 
77  struct peer
78  {
86  };
87 
88  struct tx_in_pool
89  {
102  bool relayed;
105  };
106 
107  typedef std::unordered_map<crypto::key_image, std::vector<crypto::hash> > key_images_with_tx_hashes;
108 
110  {
115  };
116 
118  {
121  };
122 
124  {
127  bool unlocked;
128  };
129 
131  {
133  bool enabled;
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 
151 
152  // not required by spec, but int error codes aren't perfect
154 
156 
157  //TODO: data member? not required, may want later.
158  };
159 
161  {
173  };
174 
175  struct DaemonInfo
176  {
190  bool mainnet;
191  bool testnet;
192  bool stagenet;
204  };
205 
207  {
211  };
212 } // namespace rpc
213 
214 } // namespace cryptonote
uint32_t rpc_credits_per_hash
Definition: message_data_structs.h:83
cryptonote::difficulty_type wide_cumulative_difficulty
Definition: message_data_structs.h:195
int32_t code
Definition: message_data_structs.h:150
crypto::hash max_used_block_hash
Definition: message_data_structs.h:95
bool in_pool
Definition: message_data_structs.h:59
uint64_t alt_blocks_count
Definition: message_data_structs.h:185
uint16_t port
Definition: message_data_structs.h:81
uint64_t weight
Definition: message_data_structs.h:93
uint64_t block_size_limit
Definition: message_data_structs.h:197
cryptonote::transaction transaction
Definition: message_data_structs.h:58
crypto::hash hash
Definition: message_data_structs.h:169
crypto::hash tx_hash
Definition: message_data_structs.h:91
uint64_t id
Definition: message_data_structs.h:79
std::vector< tx_output_indices > block_output_indices
Definition: message_data_structs.h:54
Definition: rpc_handler.h:45
Definition: message_data_structs.h:71
std::string error_str
Definition: message_data_structs.h:153
::std::string string
Definition: gtest-port.h:1097
rct::key mask
Definition: message_data_structs.h:126
Definition: cryptonote_basic.h:474
uint64_t earliest_height
Definition: message_data_structs.h:139
bool enabled
Definition: message_data_structs.h:133
uint64_t amount
Definition: message_data_structs.h:73
uint64_t amount
Definition: message_data_structs.h:111
uint64_t cumulative_difficulty
Definition: message_data_structs.h:196
cryptonote::difficulty_type wide_difficulty
Definition: message_data_structs.h:170
uint64_t grey_peerlist_size
Definition: message_data_structs.h:189
unsigned short uint16_t
Definition: stdint.h:125
uint64_t timestamp
Definition: message_data_structs.h:164
crypto::public_key key
Definition: message_data_structs.h:66
Definition: message_data_structs.h:175
uint64_t height
Definition: message_data_structs.h:60
std::string message
Definition: message_data_structs.h:155
std::vector< uint64_t > tx_output_indices
Definition: message_data_structs.h:52
bool do_not_relay
Definition: message_data_structs.h:103
uint64_t major_version
Definition: message_data_structs.h:162
unsigned char uint8_t
Definition: stdint.h:124
uint64_t recent_count
Definition: message_data_structs.h:114
cryptonote::transaction tx
Definition: message_data_structs.h:90
std::unordered_map< crypto::key_image, std::vector< crypto::hash > > key_images_with_tx_hashes
Definition: message_data_structs.h:107
Definition: message_data_structs.h:46
bool use
Definition: message_data_structs.h:148
uint64_t index
Definition: message_data_structs.h:120
output_distribution_data data
Definition: message_data_structs.h:208
Definition: message_data_structs.h:160
uint64_t reward
Definition: message_data_structs.h:172
uint64_t last_seen
Definition: message_data_structs.h:84
bool stagenet
Definition: message_data_structs.h:192
uint64_t max_used_block_height
Definition: message_data_structs.h:96
Holds cryptonote related classes and helpers.
Definition: blockchain_db.cpp:44
uint64_t fee
Definition: message_data_structs.h:94
cryptonote::difficulty_type wide_difficulty
Definition: message_data_structs.h:180
error()
Definition: message_data_structs.h:146
uint64_t depth
Definition: message_data_structs.h:168
Definition: message_data_structs.h:130
rpc
Definition: console.py:53
unsigned int uint32_t
Definition: stdint.h:126
uint32_t votes
Definition: message_data_structs.h:135
bool relayed
Definition: message_data_structs.h:102
bool unlocked
Definition: message_data_structs.h:127
uint32_t nonce
Definition: message_data_structs.h:166
uint64_t minor_version
Definition: message_data_structs.h:163
uint64_t last_failed_block_height
Definition: message_data_structs.h:99
std::string version
Definition: message_data_structs.h:203
uint64_t target
Definition: message_data_structs.h:182
uint64_t blob_size
Definition: message_data_structs.h:92
Definition: rctTypes.h:79
unsigned __int64 uint64_t
Definition: stdint.h:136
uint8_t voting
Definition: message_data_structs.h:137
bool testnet
Definition: message_data_structs.h:191
Definition: message_data_structs.h:77
uint32_t state
Definition: message_data_structs.h:138
outputs_for_amount outputs
Definition: message_data_structs.h:74
crypto::public_key key
Definition: message_data_structs.h:125
crypto::hash top_block_hash
Definition: message_data_structs.h:194
#define false
Definition: stdbool.h:37
std::vector< output_key_and_amount_index > outputs_for_amount
Definition: message_data_structs.h:69
Definition: message_data_structs.h:117
uint64_t difficulty
Definition: message_data_structs.h:171
Definition: message_data_structs.h:56
POD_CLASS public_key
Definition: crypto.h:61
Definition: message_data_structs.h:109
uint16_t rpc_port
Definition: message_data_structs.h:82
uint64_t last_relayed_time
Definition: message_data_structs.h:101
uint64_t tx_count
Definition: message_data_structs.h:183
uint32_t threshold
Definition: message_data_structs.h:136
Definition: message_data_structs.h:206
cryptonote::block block
Definition: message_data_structs.h:48
uint64_t amount
Definition: message_data_structs.h:119
uint64_t target_height
Definition: message_data_structs.h:178
uint64_t incoming_connections_count
Definition: message_data_structs.h:187
uint32_t pruning_seed
Definition: message_data_structs.h:85
uint64_t amount_index
Definition: message_data_structs.h:65
bool double_spend_seen
Definition: message_data_structs.h:104
boost::multiprecision::uint128_t difficulty_type
Definition: difficulty.h:41
uint64_t top_block_height
Definition: message_data_structs.h:179
uint64_t tx_pool_size
Definition: message_data_structs.h:184
crypto::hash last_failed_block_hash
Definition: message_data_structs.h:98
uint8_t version
Definition: message_data_structs.h:132
uint64_t amount
Definition: message_data_structs.h:209
std::string nettype
Definition: message_data_structs.h:193
uint64_t block_size_median
Definition: message_data_structs.h:199
uint64_t unlocked_count
Definition: message_data_structs.h:113
POD_CLASS hash
Definition: hash.h:49
uint64_t outgoing_connections_count
Definition: message_data_structs.h:186
uint64_t start_time
Definition: message_data_structs.h:202
uint64_t height
Definition: message_data_structs.h:167
uint64_t block_weight_median
Definition: message_data_structs.h:201
bool cumulative
Definition: message_data_structs.h:210
Definition: message_data_structs.h:143
uint64_t difficulty
Definition: message_data_structs.h:181
uint32_t ip
Definition: message_data_structs.h:80
uint32_t window
Definition: message_data_structs.h:134
signed int int32_t
Definition: stdint.h:123
Definition: message_data_structs.h:88
uint64_t total_count
Definition: message_data_structs.h:112
Definition: message_data_structs.h:63
uint64_t adjusted_time
Definition: message_data_structs.h:200
uint64_t receive_time
Definition: message_data_structs.h:100
Definition: message_data_structs.h:123
bool kept_by_block
Definition: message_data_structs.h:97
Definition: cryptonote_basic.h:204
uint64_t white_peerlist_size
Definition: message_data_structs.h:188
uint64_t height
Definition: message_data_structs.h:177
bool mainnet
Definition: message_data_structs.h:190
std::vector< cryptonote::transaction > transactions
Definition: message_data_structs.h:49
crypto::hash prev_id
Definition: message_data_structs.h:165
uint64_t block_weight_limit
Definition: message_data_structs.h:198