本文整理汇总了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;
}
示例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;
}