Monero
  • 介绍
  • 区块链
    • checkpoints
    • account
    • cryptonote_basic
    • cryptonote_basic_impl
    • cryptonote_stat_info
    • difficulty
    • hardfork
    • miner
    • subaddress_index
    • tx_extra
    • verification_context
    • blockchain
    • cryptonote_core
    • cryptonote_format_utils
    • cryptonote_core
    • cryptonote_tx_utils
    • tx_pool
  • API/客户端
    • command_server
    • electrum-words
    • core_rpc_server
    • simplewallet
    • wallet_rpc_server
    • wallet2
    • wallet2_api
  • 网络传输
    • connection_context
    • block_queue
    • cryptonote_protocol_defs
    • cryptonote_protocol_handler
    • net_node
    • net_peerlist
    • p2p_protocol_defs
  • 数据存储
    • blockchain_db
    • berkeleydb
    • lmdb
    • blockchain_import
    • blockchain_export
  • 数学/密码学
    • aesb
    • blake256
    • chacha
    • groestl
    • jh
    • keccak
    • random
    • skein
    • slow-hash
    • tree-hash
    • gen_multisig
    • multisig
    • bulletproofs
    • rctOps
    • rctSigs
Powered by GitBook
On this page

Was this helpful?

  1. 区块链

blockchain

    // TODO: evaluate whether or not each of these typedefs are left over from blockchain_storage
    typedef std::unordered_map<crypto::hash, size_t> blocks_by_id_index;

    typedef std::unordered_map<crypto::hash, transaction_chain_entry> transactions_container;

    typedef std::unordered_set<crypto::key_image> key_images_container;

    typedef std::vector<block_extended_info> blocks_container;

    typedef std::unordered_map<crypto::hash, block_extended_info> blocks_ext_by_hash;

    typedef std::unordered_map<crypto::hash, block> blocks_by_hash;

    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


    BlockchainDB* m_db;

    tx_memory_pool& m_tx_pool;

    mutable epee::critical_section m_blockchain_lock; // TODO: add here reader/writer lock

    // main chain
    transactions_container m_transactions;
    size_t m_current_block_cumul_sz_limit;
    size_t m_current_block_cumul_sz_median;

    // metadata containers
    std::unordered_map<crypto::hash, std::unordered_map<crypto::key_image, std::vector<output_data_t>>> m_scan_table;
    std::unordered_map<crypto::hash, crypto::hash> m_blocks_longhash_table;
    std::unordered_map<crypto::hash, std::unordered_map<crypto::key_image, bool>> m_check_txin_table;

    // SHA-3 hashes for each block and for fast pow checking
    std::vector<crypto::hash> m_blocks_hash_of_hashes;
    std::vector<crypto::hash> m_blocks_hash_check;
    std::vector<crypto::hash> m_blocks_txs_check;

    blockchain_db_sync_mode m_db_sync_mode;
    bool m_fast_sync;
    bool m_show_time_stats;
    bool m_db_default_sync;
    uint64_t m_db_blocks_per_sync;
    uint64_t m_max_prepare_blocks_threads;
    uint64_t m_fake_pow_calc_time;
    uint64_t m_fake_scan_time;
    uint64_t m_sync_counter;
    std::vector<uint64_t> m_timestamps;
    std::vector<difficulty_type> m_difficulties;
    uint64_t m_timestamps_and_difficulties_height;

    epee::critical_section m_difficulty_lock;
    crypto::hash m_difficulty_for_next_block_top_hash;
    difficulty_type m_difficulty_for_next_block;

    boost::asio::io_service m_async_service;
    boost::thread_group m_async_pool;
    std::unique_ptr<boost::asio::io_service::work> m_async_work_idle;

    // all alternative chains
    blocks_ext_by_hash m_alternative_chains; // crypto::hash -> block_extended_info

    // some invalid blocks
    blocks_ext_by_hash m_invalid_blocks;     // crypto::hash -> block_extended_info


    checkpoints m_checkpoints;
    bool m_enforce_dns_checkpoints;

    HardFork *m_hardfork;

    network_type m_nettype;
    bool m_offline;

    std::atomic<bool> m_cancel;
Previousverification_contextNextcryptonote_core

Last updated 5 years ago

Was this helpful?