当前位置: 首页>>代码示例>>C++>>正文


C++ data_buffer::write_uint64方法代码示例

本文整理汇总了C++中data_buffer::write_uint64方法的典型用法代码示例。如果您正苦于以下问题:C++ data_buffer::write_uint64方法的具体用法?C++ data_buffer::write_uint64怎么用?C++ data_buffer::write_uint64使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在data_buffer的用法示例。


在下文中一共展示了data_buffer::write_uint64方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: encode

void zerotime_lock::encode(data_buffer & buffer)
{
    /**
     * Encode the version.
     */
    buffer.write_uint32(m_version);

    /**
     * Encode the transaction.
     */
    m_transaction.encode(buffer);

    /**
     * Encode the transaction hash.
     */
    buffer.write_bytes(
        reinterpret_cast<const char *> (m_hash_tx.digest()),
        sha256::digest_length
    );

    /**
     * Encode the expiration.
     */
    buffer.write_uint64(m_expiration);

    /**
     * No signature is required because:
     * 1. The receiver may want to lock a non-zerotime transaction.
     * 2. It causes no harm to let other's lock the transaction.
     * 3. It conserves bandwidth and processing power.
     */
}
开发者ID:tempbottle,项目名称:vanillacoin,代码行数:32,代码来源:zerotime_lock.cpp

示例2: encode

void incentive_collaterals::encode(data_buffer & buffer)
{
    /**
     * Encode the version.
     */
    buffer.write_uint32(m_version);
    
    /**
     * Write the number of collateral entries.
     */
    buffer.write_var_int(m_collaterals.size());
    
    /**
     * Write the collateral entries.
     */
     for (auto & i : m_collaterals)
     {
        /**
         * Write the address.
         */
        buffer.write_network_address(i.addr, false);
        
        /**
         * Write the size of the wallet address.
         */
        buffer.write_var_int(i.wallet_address.size());
        
        /**
         * Write the wallet address.
         */
        buffer.write_bytes(i.wallet_address.data(), i.wallet_address.size());
        
        auto public_key = i.public_key;
        
        /**
         * Write the public key.
         */
        public_key.encode(buffer);
        
        /**
         * Write the transaction_in.
         */
        i.tx_in.encode(buffer);
        
        /**
         * Write the time.
         */
        buffer.write_uint64(i.time);
        
        /**
         * Write the protocol version.
         */
        buffer.write_uint32(i.protocol_version);
        
        /**
         * Write the protocol user agent.
         */
        buffer.write_var_int(i.protocol_version_user_agent.size());
        
        /**
         * Write the protocol version user agent.
         */
        buffer.write_bytes(
            i.protocol_version_user_agent.data(),
            i.protocol_version_user_agent.size()
        );
        
        /**
         * Write the protocol version services.
         */
        buffer.write_uint64(i.protocol_version_services);
        
        /**
         * Write the protocol version start height.
         */
        buffer.write_int32(i.protocol_version_start_height);
     }
}
开发者ID:xCoreDev,项目名称:vcash,代码行数:78,代码来源:incentive_collaterals.cpp


注:本文中的data_buffer::write_uint64方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。