Electroneum
blockchain.h
Go to the documentation of this file.
1 // Copyrights(c) 2017-2020, The Electroneum Project
2 // Copyrights(c) 2014-2019, The Monero Project
3 //
4 // All rights reserved.
5 //
6 // Redistribution and use in source and binary forms, with or without modification, are
7 // permitted provided that the following conditions are met:
8 //
9 // 1. Redistributions of source code must retain the above copyright notice, this list of
10 // conditions and the following disclaimer.
11 //
12 // 2. Redistributions in binary form must reproduce the above copyright notice, this list
13 // of conditions and the following disclaimer in the documentation and/or other
14 // materials provided with the distribution.
15 //
16 // 3. Neither the name of the copyright holder nor the names of its contributors may be
17 // used to endorse or promote products derived from this software without specific
18 // prior written permission.
19 //
20 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
21 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
22 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
23 // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
27 // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
28 // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
31 
32 #pragma once
33 #include <boost/asio/io_service.hpp>
34 #include <boost/serialization/serialization.hpp>
35 #include <boost/serialization/version.hpp>
36 #include <boost/serialization/list.hpp>
37 #include <boost/multi_index_container.hpp>
38 #include <boost/multi_index/global_fun.hpp>
39 #include <boost/multi_index/hashed_index.hpp>
40 #include <boost/multi_index/member.hpp>
41 #include <boost/algorithm/hex.hpp>
42 #include <atomic>
43 #include <functional>
44 #include <unordered_map>
45 #include <unordered_set>
46 
47 #include "span.h"
48 #include "syncobj.h"
49 #include "string_tools.h"
50 #include "rolling_median.h"
52 #include "common/util.h"
56 #include "cryptonote_tx_utils.h"
58 #include "crypto/hash.h"
63 
64 namespace tools { class Notify; }
65 
66 namespace cryptonote
67 {
68  class tx_memory_pool;
69  struct test_options;
70 
75  {
79  db_nosync
80  };
81 
89  typedef std::function<const epee::span<const unsigned char>(cryptonote::network_type network)> GetCheckpointsCallback;
90 
91  /************************************************************************/
92  /* */
93  /************************************************************************/
94  class Blockchain
95  {
96  public:
101  {
104  size_t m_blob_size;
105  std::vector<uint64_t> m_global_output_indexes;
106  };
107 
112  {
114  uint64_t height;
118  };
119 
125  Blockchain(tx_memory_pool& tx_pool);
126 
130  ~Blockchain();
131 
144  bool init(BlockchainDB* db, const network_type nettype = MAINNET, bool offline = false, const cryptonote::test_options *test_options = NULL, difficulty_type fixed_difficulty = 0, const GetCheckpointsCallback& get_checkpoints = nullptr, bool ignore_bsig = false, bool fallback_to_pow = false);
145 
156  bool init(BlockchainDB* db, HardFork*& hf, const network_type nettype = MAINNET, bool offline = false);
157 
165  bool deinit();
166 
172  void set_checkpoints(checkpoints&& chk_pts) { m_checkpoints = chk_pts; }
173 
184  bool get_blocks(uint64_t start_offset, size_t count, std::vector<std::pair<cryptonote::blobdata,block>>& blocks, std::vector<cryptonote::blobdata>& txs) const;
185 
195  bool get_blocks(uint64_t start_offset, size_t count, std::vector<std::pair<cryptonote::blobdata,block>>& blocks) const;
196 
204  bool get_alternative_blocks(std::vector<block>& blocks) const;
205 
211  size_t get_alternative_blocks_count() const;
212 
221 
231  bool get_block_by_hash(const crypto::hash &h, block &blk, bool *orphan = NULL) const;
232 
241  bool prepare_handle_incoming_blocks(const std::vector<block_complete_entry> &blocks_entry, std::vector<block> &blocks);
242 
250  bool cleanup_handle_incoming_blocks(bool force_sync = false);
251 
259  bool have_tx(const crypto::hash &id) const;
260 
268  bool have_tx_keyimges_as_spent(const transaction &tx) const;
269 
282  bool have_tx_keyimg_as_spent(const crypto::key_image &key_im) const;
283 
289  uint64_t get_current_blockchain_height() const;
290 
296  crypto::hash get_tail_id() const;
297 
305  crypto::hash get_tail_id(uint64_t& height) const;
306 
313 
318 
332  bool add_new_block(const block& bl_, block_verification_context& bvc);
333 
341  bool reset_and_set_genesis_block(const block& b);
342 
356  bool create_block_template(block& b, const account_public_address& miner_address, difficulty_type& di, uint64_t& height, uint64_t& expected_reward, const blobdata& ex_nonce);
357  bool create_block_template(block& b, const crypto::hash *from_block, const account_public_address& miner_address, difficulty_type& di, uint64_t& height, uint64_t& expected_reward, const blobdata& ex_nonce);
358 
369  bool have_block(const crypto::hash& id) const;
370 
376  size_t get_total_transactions() const;
377 
392  bool get_short_chain_history(std::list<crypto::hash>& ids) const;
393 
409  bool find_blockchain_supplement(const std::list<crypto::hash>& qblock_ids, std::vector<crypto::hash>& hashes, uint64_t& start_height, uint64_t& current_height, bool clip_pruned) const;
410 
423  bool find_blockchain_supplement(const std::list<crypto::hash>& qblock_ids, NOTIFY_RESPONSE_CHAIN_ENTRY::request& resp) const;
424 
437  bool find_blockchain_supplement(const std::list<crypto::hash>& qblock_ids, uint64_t& starter_offset) const;
438 
456  bool find_blockchain_supplement(const uint64_t req_start_block, const std::list<crypto::hash>& qblock_ids, std::vector<std::pair<std::pair<cryptonote::blobdata, crypto::hash>, std::vector<std::pair<crypto::hash, cryptonote::blobdata> > > >& blocks, uint64_t& total_height, uint64_t& start_height, bool pruned, bool get_miner_tx_hash, size_t max_count) const;
457 
471 
479  uint64_t get_num_mature_outputs(uint64_t amount) const;
480 
489  crypto::public_key get_output_key(uint64_t amount, uint64_t global_index) const;
490 
505 
515  void get_output_key_mask_unlocked(const uint64_t& amount, const uint64_t& index, crypto::public_key& key, rct::key& mask, bool& unlocked) const;
516 
527  bool get_output_distribution(uint64_t amount, uint64_t from_height, uint64_t to_height, uint64_t &start_height, std::vector<uint64_t> &distribution, uint64_t &base) const;
528 
541  bool get_tx_outputs_gindexs(const crypto::hash& tx_id, std::vector<uint64_t>& indexs) const;
542  bool get_tx_outputs_gindexs(const crypto::hash& tx_id, size_t n_txes, std::vector<std::vector<uint64_t>>& indexs) const;
543 
552  bool store_blockchain();
553 
570  bool check_tx_inputs(transaction& tx, uint64_t& pmax_used_block_height, crypto::hash& max_used_block_id, tx_verification_context &tvc, bool kept_by_block = false);
571 
579  static uint64_t get_fee_quantization_mask();
580 
594  static uint64_t get_dynamic_base_fee(uint64_t block_reward, size_t median_block_weight, uint8_t version);
595 
609  uint64_t get_dynamic_base_fee_estimate(uint64_t grace_blocks) const;
610 
623  bool check_fee(size_t tx_weight, uint64_t fee) const;
624 
638 
645 
651  uint64_t get_next_long_term_block_weight(uint64_t block_weight) const;
652 
659 
667  difficulty_type block_difficulty(uint64_t i) const;
668 
681  template<class t_ids_container, class t_blocks_container, class t_missed_container>
682  bool get_blocks(const t_ids_container& block_ids, t_blocks_container& blocks, t_missed_container& missed_bs) const;
683 
697  template<class t_ids_container, class t_tx_container, class t_missed_container>
698  bool get_transactions_blobs(const t_ids_container& txs_ids, t_tx_container& txs, t_missed_container& missed_txs, bool pruned = false) const;
699  template<class t_ids_container, class t_tx_container, class t_missed_container>
700  bool get_split_transactions_blobs(const t_ids_container& txs_ids, t_tx_container& txs, t_missed_container& missed_txs) const;
701  template<class t_ids_container, class t_tx_container, class t_missed_container>
702  bool get_transactions(const t_ids_container& txs_ids, t_tx_container& txs, t_missed_container& missed_txs) const;
703 
704  //debug functions
705 
717  void check_against_checkpoints(const checkpoints& points, bool enforce);
718 
724  void set_enforce_dns_checkpoints(bool enforce);
725 
734  bool update_checkpoints(const std::string& file_path, bool check_dns);
735 
742  // user options, must be called before calling init()
743 
753  void set_user_options(uint64_t maxthreads, bool sync_on_blocks, uint64_t sync_threshold,
754  blockchain_db_sync_mode sync_mode, bool fast_sync, std::string validator_key);
755 
761  void set_block_notify(const std::shared_ptr<tools::Notify> &notify) { m_block_notify = notify; }
762 
768  void set_reorg_notify(const std::shared_ptr<tools::Notify> &notify) { m_reorg_notify = notify; }
769 
773  void safesyncmode(const bool onoff);
774 
780  void set_show_time_stats(bool stats) { m_show_time_stats = stats; }
781 
788 
794  static const std::vector<HardFork::Params>& get_hard_fork_heights(network_type nettype);
795 
802 
809 
816 
826 
834  uint8_t get_hard_fork_version(uint64_t height) const { return m_hardfork->get(height); }
835 
842 
855  bool get_hard_fork_voting_info(uint8_t version, uint32_t &window, uint32_t &votes, uint32_t &threshold, uint64_t &earliest_height, uint8_t &voting) const;
856 
862  uint64_t get_difficulty_target() const;
863 
871  bool flush_txes_from_pool(const std::vector<crypto::hash> &txids);
872 
883  std::map<uint64_t, std::tuple<uint64_t, uint64_t, uint64_t>> get_output_histogram(const std::vector<uint64_t> &amounts, bool unlocked, uint64_t recent_cutoff, uint64_t min_count = 0) const;
884 
892  bool for_all_key_images(std::function<bool(const crypto::key_image&)>) const;
893 
903  bool for_blocks_range(const uint64_t& h1, const uint64_t& h2, std::function<bool(uint64_t, const crypto::hash&, const block&)>) const;
904 
913  bool for_all_transactions(std::function<bool(const crypto::hash&, const cryptonote::transaction&)>, bool pruned) const;
914 
922  bool for_all_outputs(std::function<bool(uint64_t amount, const crypto::hash &tx_hash, uint64_t height, size_t tx_idx)>) const;
923 
932  bool for_all_outputs(uint64_t amount, std::function<bool(uint64_t height)>) const;
933 
939  const BlockchainDB& get_db() const
940  {
941  return *m_db;
942  }
943 
950  {
951  return *m_db;
952  }
953 
961  void output_scan_worker(const uint64_t amount,const std::vector<uint64_t> &offsets,
962  std::vector<output_data_t> &outputs) const;
963 
971  void block_longhash_worker(uint64_t height, const epee::span<const block> &blocks,
972  std::unordered_map<crypto::hash, crypto::hash> &map) const;
973 
979  std::list<std::pair<block_extended_info,std::vector<crypto::hash>>> get_alternative_chains() const;
980 
981  void add_txpool_tx(const crypto::hash &txid, const cryptonote::blobdata &blob, const txpool_tx_meta_t &meta);
982  void update_txpool_tx(const crypto::hash &txid, const txpool_tx_meta_t &meta);
983  void remove_txpool_tx(const crypto::hash &txid);
984  uint64_t get_txpool_tx_count(bool include_unrelayed_txes = true) const;
985  bool get_txpool_tx_meta(const crypto::hash& txid, txpool_tx_meta_t &meta) const;
986  bool get_txpool_tx_blob(const crypto::hash& txid, cryptonote::blobdata &bd) const;
988  bool for_all_txpool_txes(std::function<bool(const crypto::hash&, const txpool_tx_meta_t&, const cryptonote::blobdata*)>, bool include_blob = false, bool include_unrelayed_txes = true) const;
989  uint32_t get_mempool_tx_livetime() const;
990 
991  bool is_within_compiled_block_hash_area(uint64_t height) const;
994  bool prune_blockchain(uint32_t pruning_seed = 0);
997 
998  void lock();
999  void unlock();
1000 
1001  void cancel();
1002 
1009 
1013  std::vector<time_t> get_last_block_timestamps(unsigned int blocks) const;
1014 
1020  void pop_blocks(uint64_t nblocks);
1021 
1025  void set_validator_key(std::string key) { m_validator_key = boost::algorithm::unhex(key); }
1026 
1027  void set_validators_list_instance(std::unique_ptr<electroneum::basic::Validators> &v) { m_validators = v.get(); }
1028 
1030 
1034  network_type get_nettype() const { return m_nettype; };
1035 
1036 
1037 #ifndef IN_UNIT_TESTS
1038  private:
1039 #endif
1040 
1041  // TODO: evaluate whether or not each of these typedefs are left over from blockchain_storage
1042  typedef std::unordered_map<crypto::hash, size_t> blocks_by_id_index;
1043 
1044  typedef std::unordered_map<crypto::hash, transaction_chain_entry> transactions_container;
1045 
1046  typedef std::unordered_set<crypto::key_image> key_images_container;
1047 
1048  typedef std::vector<block_extended_info> blocks_container;
1049 
1050  typedef std::unordered_map<crypto::hash, block_extended_info> blocks_ext_by_hash;
1051 
1052  typedef std::unordered_map<crypto::hash, block> blocks_by_hash;
1053 
1054  typedef std::map<uint64_t, std::vector<std::pair<crypto::hash, size_t>>> outputs_container; //crypto::hash - tx hash, size_t - index of out in transaction
1055 
1056 
1058 
1060 
1061  mutable epee::critical_section m_blockchain_lock; // TODO: add here reader/writer lock
1062 
1063  // main chain
1067 
1068  // metadata containers
1069  std::unordered_map<crypto::hash, std::unordered_map<crypto::key_image, std::vector<output_data_t>>> m_scan_table;
1070  std::unordered_map<crypto::hash, crypto::hash> m_blocks_longhash_table;
1071  std::unordered_map<crypto::hash, std::unordered_map<crypto::key_image, bool>> m_check_txin_table;
1072 
1073  // SHA-3 hashes for each block and for fast pow checking
1074  std::vector<crypto::hash> m_blocks_hash_check;
1075  std::vector<crypto::hash> m_blocks_txs_check;
1076 
1086  uint64_t m_sync_counter;
1088  std::vector<uint64_t> m_timestamps;
1089  std::vector<difficulty_type> m_difficulties;
1094  mutable epee::misc_utils::rolling_median_t<uint64_t> m_long_term_block_weights_cache_rolling_median;
1095 
1096  epee::critical_section m_difficulty_lock;
1099 
1100  std::string m_validator_key;
1101  std::vector<std::string> m_validators_public_keys;
1102 
1103  boost::asio::io_service m_async_service;
1104  boost::thread_group m_async_pool;
1105  std::unique_ptr<boost::asio::io_service::work> m_async_work_idle;
1106 
1107  // all alternative chains
1108  blocks_ext_by_hash m_alternative_chains; // crypto::hash -> block_extended_info
1109 
1110  // some invalid blocks
1111  blocks_ext_by_hash m_invalid_blocks; // crypto::hash -> block_extended_info
1112 
1113 
1116 
1118 
1122 
1125 
1126  std::atomic<bool> m_cancel;
1127 
1128  // block template cache
1133  uint64_t m_btc_height;
1137 
1138 
1140 
1141  std::shared_ptr<tools::Notify> m_block_notify;
1142  std::shared_ptr<tools::Notify> m_reorg_notify;
1143 
1145 
1165  template<class visitor_t>
1166  inline bool scan_outputkeys_for_indexes(size_t tx_version, const txin_to_key& tx_in_to_key, visitor_t &vis, const crypto::hash &tx_prefix_hash, uint64_t* pmax_related_block_height = NULL) const;
1167 
1188  bool check_tx_input(size_t tx_version,const txin_to_key& txin, const crypto::hash& tx_prefix_hash, const std::vector<crypto::signature>& sig, const rct::rctSig &rct_signatures, std::vector<rct::ctkey> &output_keys, uint64_t* pmax_related_block_height);
1189 
1210  bool check_tx_inputs(transaction& tx, tx_verification_context &tvc, uint64_t* pmax_used_block_height = NULL);
1211 
1224  bool switch_to_alternative_blockchain(std::list<blocks_ext_by_hash::const_iterator>& alt_chain, bool discard_disconnected_chain);
1225 
1232 
1246 
1261 
1276 
1287  bool build_alt_chain(const crypto::hash &prev_id, std::list<blocks_ext_by_hash::const_iterator>& alt_chain, std::vector<uint64_t> &timestamps, block_verification_context& bvc) const;
1288 
1297  difficulty_type get_next_difficulty_for_alternative_chain(const std::list<blocks_ext_by_hash::const_iterator>& alt_chain, block_extended_info& bei) const;
1298 
1310  bool prevalidate_miner_transaction(const block& b, uint64_t height);
1311 
1328  bool validate_miner_transaction(const block& b, size_t cumulative_block_weight, uint64_t fee, uint64_t& base_reward, uint64_t already_generated_coins, bool &partial_block_reward, uint8_t version);
1329 
1342  bool rollback_blockchain_switching(std::list<block>& original_chain, uint64_t rollback_height);
1343 
1352  void get_last_n_blocks_weights(std::vector<uint64_t>& weights, size_t count) const;
1353 
1364  uint64_t get_long_term_block_weight_median(uint64_t start_height, size_t count) const;
1365 
1376  bool is_tx_spendtime_unlocked(uint64_t unlock_time) const;
1377 
1389  bool add_block_as_invalid(const block& bl, const crypto::hash& h);
1390 
1402  bool add_block_as_invalid(const block_extended_info& bei, const crypto::hash& h);
1403 
1420  bool check_block_timestamp(const block& b, uint64_t& median_ts) const;
1421  bool check_block_timestamp(const block& b) const { uint64_t median_ts; return check_block_timestamp(b, median_ts); }
1422 
1434  bool check_block_timestamp(std::vector<uint64_t>& timestamps, const block& b, uint64_t& median_ts) const;
1435  bool check_block_timestamp(std::vector<uint64_t>& timestamps, const block& b) const { uint64_t median_ts; return check_block_timestamp(timestamps, b, median_ts); }
1436 
1445  uint64_t get_adjusted_time() const;
1446 
1458  bool complete_timestamps_vector(uint64_t start_height, std::vector<uint64_t>& timestamps) const;
1459 
1467  bool update_next_cumulative_weight_limit(uint64_t *long_term_effective_median_block_weight = NULL);
1468  void return_tx_to_pool(std::vector<std::pair<transaction, blobdata>> &txs);
1469 
1478  bool check_for_double_spend(const transaction& tx, key_images_container& keys_this_block) const;
1479 
1489  void check_ring_signature(const crypto::hash &tx_prefix_hash, const crypto::key_image &key_image,
1490  const std::vector<rct::ctkey> &pubkeys, const std::vector<crypto::signature> &sig, uint64_t &result);
1491 
1502 
1510  bool expand_transaction_2(transaction &tx, const crypto::hash &tx_prefix_hash, const std::vector<std::vector<rct::ctkey>> &pubkeys);
1511 
1516 
1522  void cache_block_template(const block &b, const cryptonote::account_public_address &address, const blobdata &nonce, const difficulty_type &diff, uint64_t height, uint64_t expected_reward, uint64_t pool_cookie);
1523 
1530  void sign_block(block& b, std::string privateKey);
1531 
1537  bool verify_block_signature(const block& b);
1538 
1539  };
1540 } // namespace cryptonote
uint64_t height
Definition: blockchain.cpp:91
uint8_t version
Definition: blockchain.cpp:90
uint8_t threshold
Definition: blockchain.cpp:92
The BlockchainDB backing store interface declaration/contract.
Definition: blockchain_db.h:344
virtual uint64_t height() const =0
fetch the current blockchain height
virtual uint32_t get_blockchain_pruning_seed() const =0
get the blockchain pruning seed
Definition: blockchain.h:95
bool m_fast_sync
Definition: blockchain.h:1078
std::vector< crypto::hash > m_blocks_txs_check
Definition: blockchain.h:1075
crypto::hash get_tail_id() const
get the hash of the most recent block on the blockchain
Definition: blockchain.cpp:720
crypto::hash get_block_id_by_height(uint64_t height) const
gets a block's hash given a height
Definition: blockchain.cpp:784
uint8_t get_ideal_hard_fork_version(uint64_t height) const
returns the newest hardfork version voted to be enabled as of a certain height
Definition: blockchain.h:825
blocks_ext_by_hash m_alternative_chains
Definition: blockchain.h:1108
bool validate_miner_transaction(const block &b, size_t cumulative_block_weight, uint64_t fee, uint64_t &base_reward, uint64_t already_generated_coins, bool &partial_block_reward, uint8_t version)
validates a miner (coinbase) transaction
Definition: blockchain.cpp:1312
std::unordered_map< crypto::hash, transaction_chain_entry > transactions_container
Definition: blockchain.h:1044
bool check_fee(size_t tx_weight, uint64_t fee) const
validate a transaction's fee
Definition: blockchain.cpp:3416
bool is_tx_spendtime_unlocked(uint64_t unlock_time) const
checks if a transaction is unlocked (its outputs spendable)
Definition: blockchain.cpp:3515
bool check_block_timestamp(const block &b) const
Definition: blockchain.h:1421
std::vector< crypto::hash > m_blocks_hash_check
Definition: blockchain.h:1074
bool prepare_handle_incoming_blocks(const std::vector< block_complete_entry > &blocks_entry, std::vector< block > &blocks)
performs some preprocessing on a group of incoming blocks to speed up verification
Definition: blockchain.cpp:4436
uint8_t get_current_hard_fork_version() const
gets the current hardfork version in use/voted for
Definition: blockchain.h:801
bool init(BlockchainDB *db, const network_type nettype=MAINNET, bool offline=false, const cryptonote::test_options *test_options=NULL, difficulty_type fixed_difficulty=0, const GetCheckpointsCallback &get_checkpoints=nullptr, bool ignore_bsig=false, bool fallback_to_pow=false)
Initialize the Blockchain state.
Definition: blockchain.cpp:328
bool get_txpool_tx_meta(const crypto::hash &txid, txpool_tx_meta_t &meta) const
Definition: blockchain.cpp:4797
bool prune_blockchain(uint32_t pruning_seed=0)
Definition: blockchain.cpp:4095
size_t m_current_block_cumul_weight_limit
Definition: blockchain.h:1065
uint64_t m_max_prepare_blocks_threads
Definition: blockchain.h:1083
bool find_blockchain_supplement(const std::list< crypto::hash > &qblock_ids, std::vector< crypto::hash > &hashes, uint64_t &start_height, uint64_t &current_height, bool clip_pruned) const
get recent block hashes for a foreign chain
Definition: blockchain.cpp:2445
bool m_db_default_sync
Definition: blockchain.h:1080
electroneum::basic::Validators * m_validators
Definition: blockchain.h:1144
uint64_t m_bytes_to_sync
Definition: blockchain.h:1087
uint64_t get_long_term_block_weight_median(uint64_t start_height, size_t count) const
gets block long term weight median
Definition: blockchain.cpp:1380
epee::critical_section m_difficulty_lock
Definition: blockchain.h:1096
std::unordered_map< crypto::hash, size_t > blocks_by_id_index
Definition: blockchain.h:1034
std::vector< std::string > m_validators_public_keys
Definition: blockchain.h:1101
bool get_tx_outputs_gindexs(const crypto::hash &tx_id, std::vector< uint64_t > &indexs) const
gets the global indices for outputs from a given transaction
Definition: blockchain.cpp:2690
bool m_enforce_dns_checkpoints
Definition: blockchain.h:1115
void normalize_v7_difficulties()
Normalize the cumulative difficulty for V7 blocks, fixing the differing difficulty among nodes.
Definition: blockchain.cpp:981
bool get_block_by_hash(const crypto::hash &h, block &blk, bool *orphan=NULL) const
gets the block with a given hash
Definition: blockchain.cpp:811
bool handle_block_to_main_chain(const block &bl, block_verification_context &bvc)
validate and add a new block to the end of the blockchain
Definition: blockchain.cpp:2591
void safesyncmode(const bool onoff)
Put DB in safe sync mode.
Definition: blockchain.cpp:4844
uint64_t m_long_term_block_weights_window
Definition: blockchain.h:1091
bool switch_to_alternative_blockchain(std::list< blocks_ext_by_hash::const_iterator > &alt_chain, bool discard_disconnected_chain)
performs a blockchain reorganization according to the longest chain rule
Definition: blockchain.cpp:1077
epee::critical_section m_blockchain_lock
Definition: blockchain.h:1061
void add_txpool_tx(const crypto::hash &txid, const cryptonote::blobdata &blob, const txpool_tx_meta_t &meta)
Definition: blockchain.cpp:4777
block pop_block_from_blockchain()
removes the most recent block from the blockchain
Definition: blockchain.cpp:616
void load_compiled_in_block_hashes(const GetCheckpointsCallback &get_checkpoints)
loads block hashes from compiled-in data set
crypto::public_key get_output_key(uint64_t amount, uint64_t global_index) const
get the public key for an output
Definition: blockchain.cpp:2110
uint64_t m_long_term_effective_median_block_weight
Definition: blockchain.h:1092
BlockchainDB & get_db()
get a reference to the BlockchainDB in use by Blockchain
Definition: blockchain.h:949
bool expand_transaction_2(transaction &tx, const crypto::hash &tx_prefix_hash, const std::vector< std::vector< rct::ctkey >> &pubkeys)
expands v2 transaction data from blockchain
Definition: blockchain.cpp:2873
void update_txpool_tx(const crypto::hash &txid, const txpool_tx_meta_t &meta)
Definition: blockchain.cpp:4782
bool add_block_as_invalid(const block &bl, const crypto::hash &h)
stores an invalid block in a separate container
Definition: blockchain.cpp:2547
network_type get_nettype() const
get blockchain nettype
Definition: blockchain.h:1034
bool get_split_transactions_blobs(const t_ids_container &txs_ids, t_tx_container &txs, t_missed_container &missed_txs) const
Definition: blockchain.cpp:2377
uint64_t m_fake_scan_time
Definition: blockchain.h:1085
void set_enforce_dns_checkpoints(bool enforce)
configure whether or not to enforce DNS-based checkpoints
Definition: blockchain.cpp:4324
bool check_blockchain_pruning()
Definition: blockchain.cpp:4113
std::vector< block_extended_info > blocks_container
Definition: blockchain.h:1048
BlockchainDB * m_db
Definition: blockchain.h:1057
blobdata m_btc_nonce
Definition: blockchain.h:1131
uint64_t get_dynamic_base_fee_estimate(uint64_t grace_blocks) const
get dynamic per kB or byte fee estimate for the next few blocks
Definition: blockchain.cpp:3471
boost::asio::io_service m_async_service
Definition: blockchain.h:1103
void output_scan_worker(const uint64_t amount, const std::vector< uint64_t > &offsets, std::vector< output_data_t > &outputs) const
get a number of outputs of a specific amount
Definition: blockchain.cpp:4413
size_t m_current_block_cumul_weight_median
Definition: blockchain.h:1066
uint64_t get_next_long_term_block_weight(uint64_t block_weight) const
gets the long term block weight for a new block
Definition: blockchain.cpp:4122
std::unordered_map< crypto::hash, std::unordered_map< crypto::key_image, bool > > m_check_txin_table
Definition: blockchain.h:1071
network_type m_nettype
Definition: blockchain.h:1119
bool update_checkpoints(const std::string &file_path, bool check_dns)
loads new checkpoints from a file and optionally from DNS
Definition: blockchain.cpp:4289
uint64_t get_txpool_tx_count(bool include_unrelayed_txes=true) const
Definition: blockchain.cpp:4792
bool check_block_timestamp(const block &b, uint64_t &median_ts) const
checks a block's timestamp
Definition: blockchain.cpp:3629
bool is_within_compiled_block_hash_area() const
Definition: blockchain.h:992
~Blockchain()
Blockchain destructor.
Definition: blockchain.cpp:155
void set_show_time_stats(bool stats)
set whether or not to show/print time statistics
Definition: blockchain.h:780
uint64_t m_timestamps_and_difficulties_height
Definition: blockchain.h:1090
std::unordered_map< crypto::hash, block_extended_info > blocks_ext_by_hash
Definition: blockchain.h:1050
account_public_address m_btc_address
Definition: blockchain.h:1130
bool deinit()
Uninitializes the blockchain state.
Definition: blockchain.cpp:543
blockchain_db_sync_mode m_db_sync_mode
Definition: blockchain.h:1077
crypto::hash m_long_term_block_weights_cache_tip_hash
Definition: blockchain.h:1093
static const std::vector< HardFork::Params > & get_hard_fork_heights(network_type nettype)
gets the hardfork heights of given network
Definition: blockchain.cpp:4861
HardFork::State get_hard_fork_state() const
gets the hardfork voting state object
Definition: blockchain.cpp:4856
uint64_t m_sync_counter
Definition: blockchain.h:1086
difficulty_type m_difficulty_for_next_block
Definition: blockchain.h:1098
uint64_t get_current_cumulative_block_weight_median() const
gets the block weight median based on recent blocks (same window as for the limit)
Definition: blockchain.cpp:1434
difficulty_type block_difficulty(uint64_t i) const
gets the difficulty of the block with a given height
Definition: blockchain.cpp:2280
bool m_show_time_stats
Definition: blockchain.h:1079
std::unordered_map< crypto::hash, crypto::hash > m_blocks_longhash_table
Definition: blockchain.h:1070
bool scan_outputkeys_for_indexes(size_t tx_version, const txin_to_key &tx_in_to_key, visitor_t &vis, const crypto::hash &tx_prefix_hash, uint64_t *pmax_related_block_height=NULL) const
collects the keys for all outputs being "spent" as an input
Definition: blockchain.cpp:185
electroneum::basic::Validator get_validator_by_height(uint64_t height)
Definition: blockchain.cpp:5094
difficulty_type get_next_difficulty_for_alternative_chain(const std::list< blocks_ext_by_hash::const_iterator > &alt_chain, block_extended_info &bei) const
gets the difficulty requirement for a new block on an alternate chain
Definition: blockchain.cpp:1178
std::vector< difficulty_type > m_difficulties
Definition: blockchain.h:1089
void set_block_notify(const std::shared_ptr< tools::Notify > &notify)
sets a block notify object to call for every new block
Definition: blockchain.h:761
tx_memory_pool & m_tx_pool
Definition: blockchain.h:1059
bool verify_block_signature(const block &b)
Verify block's digital signature.
Definition: blockchain.cpp:1700
bool check_tx_input(size_t tx_version, const txin_to_key &txin, const crypto::hash &tx_prefix_hash, const std::vector< crypto::signature > &sig, const rct::rctSig &rct_signatures, std::vector< rct::ctkey > &output_keys, uint64_t *pmax_related_block_height)
collect output public keys of a transaction input set
Definition: blockchain.cpp:3542
bool check_block_timestamp(std::vector< uint64_t > &timestamps, const block &b) const
Definition: blockchain.h:1435
void set_reorg_notify(const std::shared_ptr< tools::Notify > &notify)
sets a reorg notify object to call for every reorg
Definition: blockchain.h:768
uint64_t m_btc_expected_reward
Definition: blockchain.h:1135
bool m_ignore_bsig
Definition: blockchain.h:1123
uint64_t m_btc_height
Definition: blockchain.h:1133
bool get_alternative_blocks(std::vector< block > &blocks) const
compiles a list of all blocks stored as alternative chains
Definition: blockchain.cpp:2070
std::atomic< bool > m_cancel
Definition: blockchain.h:1126
bool update_blockchain_pruning()
Definition: blockchain.cpp:4104
void on_new_tx_from_block(const cryptonote::transaction &tx)
called when we see a tx originating from a block
Definition: blockchain.cpp:2706
void check_against_checkpoints(const checkpoints &points, bool enforce)
check the blockchain against a set of checkpoints
Definition: blockchain.cpp:4251
crypto::hash m_difficulty_for_next_block_top_hash
Definition: blockchain.h:1097
Blockchain(tx_memory_pool &tx_pool)
Blockchain constructor.
Definition: blockchain.cpp:140
bool get_output_distribution(uint64_t amount, uint64_t from_height, uint64_t to_height, uint64_t &start_height, std::vector< uint64_t > &distribution, uint64_t &base) const
gets per block distribution of outputs of a given amount
Definition: blockchain.cpp:2170
bool complete_timestamps_vector(uint64_t start_height, std::vector< uint64_t > &timestamps) const
finish an alternate chain's timestamp window from the main chain
Definition: blockchain.cpp:1722
bool check_tx_outputs(const transaction &tx, tx_verification_context &tvc)
check that a transaction's outputs conform to current standards
Definition: blockchain.cpp:2764
uint64_t get_current_cumulative_block_weight_limit() const
gets the block weight limit based on recent blocks
Definition: blockchain.cpp:1428
std::vector< time_t > get_last_block_timestamps(unsigned int blocks) const
returns the timestamps of the last N blocks
Definition: blockchain.cpp:967
bool for_blocks_range(const uint64_t &h1, const uint64_t &h2, std::function< bool(uint64_t, const crypto::hash &, const block &)>) const
perform a check on all blocks in the blockchain in the given range
Definition: blockchain.cpp:5055
uint64_t m_btc_pool_cookie
Definition: blockchain.h:1134
bool rollback_blockchain_switching(std::list< block > &original_chain, uint64_t rollback_height)
reverts the blockchain to its previous state following a failed switch
Definition: blockchain.cpp:1035
bool store_blockchain()
stores the blockchain
Definition: blockchain.cpp:513
uint64_t get_num_mature_outputs(uint64_t amount) const
get number of outputs of an amount past the minimum spendable age
Definition: blockchain.cpp:2092
bool get_transactions_blobs(const t_ids_container &txs_ids, t_tx_container &txs, t_missed_container &missed_txs, bool pruned=false) const
gets transactions based on a list of transaction hashes
Definition: blockchain.cpp:2339
difficulty_type get_difficulty_for_next_block()
returns the difficulty target the next block to be added must meet
Definition: blockchain.cpp:854
std::list< std::pair< block_extended_info, std::vector< crypto::hash > > > get_alternative_chains() const
returns a set of known alternate chains
Definition: blockchain.cpp:4909
uint8_t get_next_hard_fork_version() const
returns the next hardfork version
Definition: blockchain.h:815
bool check_tx_inputs(transaction &tx, uint64_t &pmax_used_block_height, crypto::hash &max_used_block_id, tx_verification_context &tvc, bool kept_by_block=false)
validates a transaction's inputs
Definition: blockchain.cpp:2732
std::shared_ptr< tools::Notify > m_reorg_notify
Definition: blockchain.h:1142
void get_last_n_blocks_weights(std::vector< uint64_t > &weights, size_t count) const
gets recent block weights for median calculation
Definition: blockchain.cpp:1365
uint64_t m_fake_pow_calc_time
Definition: blockchain.h:1084
std::vector< uint64_t > m_timestamps
Definition: blockchain.h:1088
void invalidate_block_template_cache()
invalidates any cached block template
Definition: blockchain.cpp:5075
bool have_block(const crypto::hash &id) const
checks if a block is known about with a given hash
Definition: blockchain.cpp:2565
std::map< uint64_t, std::vector< std::pair< crypto::hash, size_t > > > outputs_container
Definition: blockchain.h:1054
bool cleanup_handle_incoming_blocks(bool force_sync=false)
incoming blocks post-processing, cleanup, and disk sync
Definition: blockchain.cpp:4349
bool m_offline
Definition: blockchain.h:1120
difficulty_type m_fixed_difficulty
Definition: blockchain.h:1121
void remove_txpool_tx(const crypto::hash &txid)
Definition: blockchain.cpp:4787
uint8_t get_hard_fork_version(uint64_t height) const
returns the actual hardfork version for a given block height
Definition: blockchain.h:834
bool for_all_txpool_txes(std::function< bool(const crypto::hash &, const txpool_tx_meta_t &, const cryptonote::blobdata *)>, bool include_blob=false, bool include_unrelayed_txes=true) const
Definition: blockchain.cpp:4812
bool for_all_transactions(std::function< bool(const crypto::hash &, const cryptonote::transaction &)>, bool pruned) const
perform a check on all transactions in the blockchain
Definition: blockchain.cpp:5060
uint64_t get_difficulty_target() const
get difficulty target based on chain and hardfork version
Definition: blockchain.cpp:4899
bool check_for_double_spend(const transaction &tx, key_images_container &keys_this_block) const
make sure a transaction isn't attempting a double-spend
Definition: blockchain.cpp:2614
void block_longhash_worker(uint64_t height, const epee::span< const block > &blocks, std::unordered_map< crypto::hash, crypto::hash > &map) const
computes the "short" and "long" hashes for a set of blocks
Definition: blockchain.cpp:4330
bool for_all_outputs(std::function< bool(uint64_t amount, const crypto::hash &tx_hash, uint64_t height, size_t tx_idx)>) const
perform a check on all outputs in the blockchain
Definition: blockchain.cpp:5065
std::string m_validator_key
Definition: blockchain.h:1100
static uint64_t get_fee_quantization_mask()
get fee quantization mask
Definition: blockchain.cpp:3365
HardFork * m_hardfork
Definition: blockchain.h:1117
boost::thread_group m_async_pool
Definition: blockchain.h:1104
uint32_t get_mempool_tx_livetime() const
Definition: blockchain.cpp:4817
void set_validator_key(std::string key)
set validator key
Definition: blockchain.h:1025
blocks_ext_by_hash m_invalid_blocks
Definition: blockchain.h:1111
void set_validators_list_instance(std::unique_ptr< electroneum::basic::Validators > &v)
Definition: blockchain.h:1027
bool handle_alternative_block(const block &b, const crypto::hash &id, block_verification_context &bvc)
validate and add a new block to an alternate blockchain
Definition: blockchain.cpp:1794
bool m_btc_valid
Definition: blockchain.h:1136
block m_btc
Definition: blockchain.h:1129
const BlockchainDB & get_db() const
get a reference to the BlockchainDB in use by Blockchain
Definition: blockchain.h:939
size_t get_alternative_blocks_count() const
returns the number of alternative blocks stored
Definition: blockchain.cpp:2083
uint8_t get_ideal_hard_fork_version() const
returns the newest hardfork version known to the blockchain
Definition: blockchain.h:808
uint32_t get_blockchain_pruning_seed() const
Definition: blockchain.h:993
bool m_fallback_to_pow
Definition: blockchain.h:1124
static uint64_t get_dynamic_base_fee(uint64_t block_reward, size_t median_block_weight, uint8_t version)
get dynamic per kB or byte fee for a given block weight
Definition: blockchain.cpp:3378
bool have_tx(const crypto::hash &id) const
search the blockchain for a transaction by hash
Definition: blockchain.cpp:161
void cache_block_template(const block &b, const cryptonote::account_public_address &address, const blobdata &nonce, const difficulty_type &diff, uint64_t height, uint64_t expected_reward, uint64_t pool_cookie)
stores a new cached block template
Definition: blockchain.cpp:5081
bool for_all_key_images(std::function< bool(const crypto::key_image &)>) const
perform a check on all key images in the blockchain
Definition: blockchain.cpp:5050
epee::misc_utils::rolling_median_t< uint64_t > m_long_term_block_weights_cache_rolling_median
Definition: blockchain.h:1094
std::map< uint64_t, std::tuple< uint64_t, uint64_t, uint64_t > > get_output_histogram(const std::vector< uint64_t > &amounts, bool unlocked, uint64_t recent_cutoff, uint64_t min_count=0) const
return a histogram of outputs on the blockchain
Definition: blockchain.cpp:4904
size_t get_total_transactions() const
gets the total number of transactions on the main chain
Definition: blockchain.cpp:2598
uint64_t get_earliest_ideal_height_for_version(uint8_t version) const
returns the earliest block a given version may activate
Definition: blockchain.h:841
bool reset_and_set_genesis_block(const block &b)
clears the blockchain and starts a new one
Definition: blockchain.cpp:695
void set_user_options(uint64_t maxthreads, bool sync_on_blocks, uint64_t sync_threshold, blockchain_db_sync_mode sync_mode, bool fast_sync, std::string validator_key)
Update the validators public key by fetching data from electroneum's endpoint.
Definition: blockchain.cpp:4826
void check_ring_signature(const crypto::hash &tx_prefix_hash, const crypto::key_image &key_image, const std::vector< rct::ctkey > &pubkeys, const std::vector< crypto::signature > &sig, uint64_t &result)
validates a transaction input's ring signature
Definition: blockchain.cpp:3351
bool have_tx_keyimges_as_spent(const transaction &tx) const
check if any key image in a transaction has already been spent
Definition: blockchain.cpp:2862
void lock()
Definition: blockchain.cpp:5040
std::shared_ptr< tools::Notify > m_block_notify
Definition: blockchain.h:1141
void unlock()
Definition: blockchain.cpp:5045
bool update_next_cumulative_weight_limit(uint64_t *long_term_effective_median_block_weight=NULL)
calculate the block weight limit for the next block to be added
Definition: blockchain.cpp:4142
bool flush_txes_from_pool(const std::vector< crypto::hash > &txids)
remove transactions from the transaction pool (if present)
Definition: blockchain.cpp:3679
bool m_db_sync_on_blocks
Definition: blockchain.h:1081
uint64_t m_db_sync_threshold
Definition: blockchain.h:1082
transactions_container m_transactions
Definition: blockchain.h:1064
std::unordered_set< crypto::key_image > key_images_container
Definition: blockchain.h:1046
bool get_short_chain_history(std::list< crypto::hash > &ids) const
gets the hashes for a subset of the blockchain
Definition: blockchain.cpp:742
std::unique_ptr< boost::asio::io_service::work > m_async_work_idle
Definition: blockchain.h:1105
bool get_blocks(uint64_t start_offset, size_t count, std::vector< std::pair< cryptonote::blobdata, block >> &blocks, std::vector< cryptonote::blobdata > &txs) const
get blocks and transactions from blocks based on start height and count
Definition: blockchain.cpp:1973
bool add_new_block(const block &bl_, block_verification_context &bvc)
adds a block to the blockchain
Definition: blockchain.cpp:4218
bool get_outs(const COMMAND_RPC_GET_OUTPUTS_BIN::request &req, COMMAND_RPC_GET_OUTPUTS_BIN::response &res) const
gets specific outputs to mix with
Definition: blockchain.cpp:2117
bool prevalidate_miner_transaction(const block &b, uint64_t height)
sanity checks a miner transaction before validating an entire block
Definition: blockchain.cpp:1284
std::unordered_map< crypto::hash, std::unordered_map< crypto::key_image, std::vector< output_data_t > > > m_scan_table
Definition: blockchain.h:1069
void return_tx_to_pool(std::vector< std::pair< transaction, blobdata >> &txs)
Definition: blockchain.cpp:3659
bool create_block_template(block &b, const account_public_address &miner_address, difficulty_type &di, uint64_t &height, uint64_t &expected_reward, const blobdata &ex_nonce)
creates a new block to mine against
Definition: blockchain.cpp:1715
checkpoints m_checkpoints
Definition: blockchain.h:1114
bool m_batch_success
Definition: blockchain.h:1139
void cancel()
Definition: blockchain.cpp:4942
bool have_tx_keyimg_as_spent(const crypto::key_image &key_im) const
check if a key image is already spent on the blockchain
Definition: blockchain.cpp:171
void sign_block(block &b, std::string privateKey)
Digitally sign the block.
Definition: blockchain.cpp:1688
std::unordered_map< crypto::hash, block > blocks_by_hash
Definition: blockchain.h:1052
bool handle_get_objects(NOTIFY_REQUEST_GET_OBJECTS::request &arg, NOTIFY_RESPONSE_GET_OBJECTS::request &rsp)
retrieves a set of blocks and their transactions, and possibly other transactions
Definition: blockchain.cpp:2023
bool get_txpool_tx_blob(const crypto::hash &txid, cryptonote::blobdata &bd) const
Definition: blockchain.cpp:4802
difficulty_type m_btc_difficulty
Definition: blockchain.h:1132
void get_output_key_mask_unlocked(const uint64_t &amount, const uint64_t &index, crypto::public_key &key, rct::key &mask, bool &unlocked) const
gets an output's key and unlocked state
Definition: blockchain.cpp:2161
bool build_alt_chain(const crypto::hash &prev_id, std::list< blocks_ext_by_hash::const_iterator > &alt_chain, std::vector< uint64_t > &timestamps, block_verification_context &bvc) const
builds a list of blocks connecting a block to the main chain
Definition: blockchain.cpp:1742
uint64_t get_adjusted_time() const
get the "adjusted time"
Definition: blockchain.cpp:3600
bool get_transactions(const t_ids_container &txs_ids, t_tx_container &txs, t_missed_container &missed_txs) const
Definition: blockchain.cpp:2411
uint64_t get_current_blockchain_height() const
get the current height of the blockchain
Definition: blockchain.cpp:316
void pop_blocks(uint64_t nblocks)
removes blocks from the top of the blockchain
Definition: blockchain.cpp:583
bool get_hard_fork_voting_info(uint8_t version, uint32_t &window, uint32_t &votes, uint32_t &threshold, uint64_t &earliest_height, uint8_t &voting) const
get information about hardfork voting for a version
Definition: blockchain.cpp:4894
void set_checkpoints(checkpoints &&chk_pts)
assign a set of blockchain checkpoint hashes
Definition: blockchain.h:172
Definition: hardfork.h:40
State
Definition: hardfork.h:42
uint8_t get_ideal_version() const
returns the latest "ideal" version
Definition: hardfork.cpp:367
uint8_t get_current_version() const
returns the current version
Definition: hardfork.cpp:361
uint8_t get_next_version() const
returns the next version
Definition: hardfork.cpp:397
uint64_t get_earliest_ideal_height_for_version(uint8_t version) const
returns the earliest block a given version may activate
Definition: hardfork.cpp:384
uint8_t get(uint64_t height) const
returns the hard fork version for the given block height
Definition: hardfork.cpp:348
A container for blockchain checkpoints.
Definition: checkpoints.h:52
Definition: cryptonote_basic.h:205
Transaction pool, handles transactions which are not part of a block.
Definition: tx_pool.h:95
Definition: validators.h:72
Definition: validators.h:139
Definition: base.py:1
int b
Definition: base.py:1
Definition: blocks.cpp:13
POD_CLASS public_key
Definition: crypto.h:76
POD_CLASS key_image
Definition: crypto.h:102
POD_CLASS hash
Definition: hash.h:50
Holds cryptonote related classes and helpers.
Definition: db_bdb.cpp:226
boost::multiprecision::uint128_t difficulty_type
Definition: difficulty.h:43
network_type
Definition: cryptonote_config.h:243
@ MAINNET
Definition: cryptonote_config.h:244
blockchain_db_sync_mode
Definition: blockchain.h:75
@ db_async
handle syncing calls instead of the backing db, asynchronously
Definition: blockchain.h:78
@ db_nosync
Leave syncing up to the backing db (safest, but slowest because of disk I/O)
Definition: blockchain.h:79
@ db_sync
handle syncing calls instead of the backing db, synchronously
Definition: blockchain.h:77
@ db_defaultsync
user didn't specify, use db_async
Definition: blockchain.h:76
std::string blobdata
Definition: blobdatatype.h:39
std::function< const epee::span< const unsigned char >cryptonote::network_type network)> GetCheckpointsCallback
Callback routine that returns checkpoints data for specific network type.
Definition: blockchain.h:89
mdb_size_t count(MDB_cursor *cur)
Definition: value_stream.cpp:39
Various Tools.
Definition: apply_permutation.h:40
container for passing a block and metadata about it on the blockchain
Definition: blockchain.h:112
uint64_t already_generated_coins
the total coins minted after that block
Definition: blockchain.h:117
size_t block_cumulative_weight
the weight of the block
Definition: blockchain.h:115
uint64_t height
the height of the block in the blockchain
Definition: blockchain.h:114
block bl
the block
Definition: blockchain.h:113
difficulty_type cumulative_difficulty
the accumulated difficulty after that block
Definition: blockchain.h:116
Now-defunct (TODO: remove) struct from in-memory blockchain.
Definition: blockchain.h:101
transaction tx
Definition: blockchain.h:102
size_t m_blob_size
Definition: blockchain.h:104
uint64_t m_keeper_block_height
Definition: blockchain.h:103
std::vector< uint64_t > m_global_output_indexes
Definition: blockchain.h:105
epee::misc_utils::struct_init< request_t > request
Definition: core_rpc_server_commands_defs.h:503
epee::misc_utils::struct_init< response_t > response
Definition: core_rpc_server_commands_defs.h:534
epee::misc_utils::struct_init< request_t > request
Definition: cryptonote_protocol_defs.h:184
epee::misc_utils::struct_init< request_t > request
Definition: cryptonote_protocol_defs.h:263
epee::misc_utils::struct_init< request_t > request
Definition: cryptonote_protocol_defs.h:205
Definition: cryptonote_basic.h:453
Definition: verification_context.h:55
Definition: cryptonote_basic.h:410
Definition: cryptonote_core.h:57
Definition: verification_context.h:39
Definition: cryptonote_basic.h:125
a struct containing txpool per transaction metadata
Definition: blockchain_db.h:137
Definition: rctTypes.h:78
Definition: rctTypes.h:436