比特币源码研读(3)数据结构-交易Transaction

论坛 期权论坛 区块链     
chaors   2018-11-20 23:38   4492   0
            上一篇:数据结构-区块Block
首先,通过blockchain.info查看一笔交易的基本数据结构:

blockchain.info_1
blockchain.info_2
blockchain.info_3源码初窥
  • 代码路径: bitcoin/src/private
[h2]COutPut[/h2][code]/** An outpoint - a combination of a transaction hash and an index n into its vout *** 一个交易哈希值与输出下标的集合*/class COutPoint{public:    uint256 hash;       //交易哈西    uint32_t n;         //对应序列号    COutPoint(): n((uint32_t) -1) { }           COutPoint(const uint256& hashIn, uint32_t nIn): hash(hashIn), n(nIn) { }    ADD_SERIALIZE_METHODS;      //用来序列化数据结构,方便存储和传输    template     inline void SerializationOp(Stream& s, Operation ser_action) {        READWRITE(hash);        READWRITE(n);    }    void SetNull() { hash.SetNull(); n = (uint32_t) -1; }    bool IsNull() const { return (hash.IsNull() && n == (uint32_t) -1); }    //小于号
分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:70
帖子:14
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP