Mastering Monero
  • 介绍
  • 前言
  • 快速术语检索
  • 介绍
    • 环签名
    • 隐藏地址
    • 环机密交易
    • 密钥镜像
    • 范围证明
  • 门罗币的原理
  • 门罗币客户端
  • 密钥、地址、钱包
    • 普通地址
    • 子地址
    • 多重签名地址
  • 交易
  • 门罗币网络
  • 区块链
  • 挖矿与共识
    • 算法介绍
    • 算法背景
    • 挖矿软件
    • 矿池
  • 门罗币安全
    • 升级机制
  • CryptoNote
    • Features
    • Inside
    • Wiki
    • whitepaper
  • 附录
  • 数据存储
  • 助记词
  • 数据结构
    • 区块链
    • 账号、钱包、地址
    • 底层
    • 其它
  • 有问有答
  • 硬件钱包
Powered by GitBook
On this page

Was this helpful?

  1. 数据结构

其它

typedef std::uint64_t difficulty_type;
namespace cryptonote
{
  /************************************************************************/
  /*                                                                      */
  /************************************************************************/
  struct tx_verification_context
  {
    bool m_should_be_relayed;
    bool m_verifivation_failed; //bad tx, should drop connection
    bool m_verifivation_impossible; //the transaction is related with an alternative blockchain
    bool m_added_to_pool; 
    bool m_low_mixin;
    bool m_double_spend;
    bool m_invalid_input;
    bool m_invalid_output;
    bool m_too_big;
    bool m_overspend;
    bool m_fee_too_low;
    bool m_not_rct;
  };

  struct block_verification_context
  {
    bool m_added_to_main_chain;
    bool m_verifivation_failed; //bad block, should drop connection
    bool m_marked_as_orphaned;
    bool m_already_exists;
    bool m_partial_block_reward;
  };
}
  typedef std::pair<std::pair<double, std::time_t>, crypto::hash> tx_by_fee_and_receive_time_entry;
  typedef std::set<tx_by_fee_and_receive_time_entry, txCompare> sorted_tx_container;
typedef struct mdb_block_info
{
  uint64_t bi_height;
  uint64_t bi_timestamp;
  uint64_t bi_coins;
  uint64_t bi_size; // a size_t really but we need 32-bit compat
  difficulty_type bi_diff;
  crypto::hash bi_hash;
} mdb_block_info;

typedef struct blk_height {
    crypto::hash bh_hash;
    uint64_t bh_height;
} blk_height;

typedef struct txindex {
    crypto::hash key;
    tx_data_t data;
} txindex;

typedef struct pre_rct_outkey {
    uint64_t amount_index;
    uint64_t output_id;
    pre_rct_output_data_t data;
} pre_rct_outkey;

typedef struct outkey {
    uint64_t amount_index;
    uint64_t output_id;
    output_data_t data;
} outkey;

typedef struct outtx {
    uint64_t output_id;
    crypto::hash tx_hash;
    uint64_t local_index;
} outtx;
struct pre_rct_output_data_t
{
  crypto::public_key pubkey;       //!< the output's public key (for spend verification)
  uint64_t           unlock_time;  //!< the output's unlock time (or height)
  uint64_t           height;       //!< the height of the block which created the output
};
Previous底层Next有问有答

Last updated 5 years ago

Was this helpful?