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


C++ Watcher::get_tx_height方法代码示例

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


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

示例1: ABC_BridgeFilterTransactions

/**
 * Filters a transaction list, removing any that aren't found in the
 * watcher database.
 * @param aTransactions The array to filter. This will be modified in-place.
 * @param pCount        The array length. This will be updated upon return.
 */
tABC_CC ABC_BridgeFilterTransactions(Wallet &self,
                                     tABC_TxInfo **aTransactions,
                                     unsigned int *pCount,
                                     tABC_Error *pError)
{
    tABC_CC cc = ABC_CC_Ok;
    tABC_TxInfo *const *end = aTransactions + *pCount;
    tABC_TxInfo *const *si = aTransactions;
    tABC_TxInfo **di = aTransactions;

    Watcher *watcher = nullptr;
    ABC_CHECK_NEW(watcherFind(watcher, self));

    while (si < end)
    {
        tABC_TxInfo *pTx = *si++;

        int height;
        bc::hash_digest txid;
        if (!bc::decode_hash(txid, pTx->szMalleableTxId))
            ABC_RET_ERROR(ABC_CC_ParseError, "Bad txid");
        if (watcher->get_tx_height(txid, height))
        {
            *di++ = pTx;
        }
        else
        {
            ABC_TxFreeTransaction(pTx);
        }
    }
    *pCount = di - aTransactions;

exit:
    return cc;
}
开发者ID:TSchnaars,项目名称:airbitz-core,代码行数:41,代码来源:WatcherBridge.cpp

示例2:

tABC_CC
ABC_BridgeTxHeight(Wallet &self, const char *szTxId, unsigned int *height, tABC_Error *pError)
{
    tABC_CC cc = ABC_CC_Ok;
    int height_;
    bc::hash_digest txid;

    Watcher *watcher = nullptr;
    ABC_CHECK_NEW(watcherFind(watcher, self));

    if (!bc::decode_hash(txid, szTxId))
        ABC_RET_ERROR(ABC_CC_ParseError, "Bad txid");
    if (!watcher->get_tx_height(txid, height_))
    {
        cc = ABC_CC_Synchronizing;
    }
    *height = height_;
exit:
    return cc;
}
开发者ID:TSchnaars,项目名称:airbitz-core,代码行数:20,代码来源:WatcherBridge.cpp


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