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