本文整理汇总了C++中OTPseudonym::GetSetOpenCronItems方法的典型用法代码示例。如果您正苦于以下问题:C++ OTPseudonym::GetSetOpenCronItems方法的具体用法?C++ OTPseudonym::GetSetOpenCronItems怎么用?C++ OTPseudonym::GetSetOpenCronItems使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OTPseudonym
的用法示例。
在下文中一共展示了OTPseudonym::GetSetOpenCronItems方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onFinalReceipt
//.........这里部分代码省略.........
}
}
// -------------------------------
// First, we are closing the transaction number ITSELF, of this cron item,
// as an active issued number on the originating nym. (Changing it to CLOSED.)
//
// Second, we're verifying the CLOSING number, and using it as the closing number
// on the FINAL RECEIPT (with that receipt being "InReferenceTo" this->GetTransactionNum())
//
const long lRecipientOpeningNumber = this->GetRecipientOpeningNum();
const long lRecipientClosingNumber = this->GetRecipientClosingNum();
// -----------------------------------------------------------------------------------
const long lSenderOpeningNumber = theOrigCronItem.GetTransactionNum();
const long lSenderClosingNumber = (theOrigCronItem.GetCountClosingNumbers() > 0) ?
theOrigCronItem.GetClosingTransactionNoAt(0) : 0; // index 0 is closing number for sender, since GetTransactionNum() is his opening #.
// ----------------------------------
const OTString strServerID(GetServerID());
// -----------------------------------------------------------------
//
if ((lSenderOpeningNumber > 0) &&
theOriginator.VerifyIssuedNum(strServerID, lSenderOpeningNumber))
{
// The Nym (server side) stores a list of all opening and closing cron #s.
// So when the number is released from the Nym, we also take it off that list.
//
std::set<long> & theIDSet = theOriginator.GetSetOpenCronItems();
theIDSet.erase(lSenderOpeningNumber);
// the RemoveIssued call means the original transaction# (to find this cron item on cron) is now CLOSED.
// But the Transaction itself is still OPEN. How? Because the CLOSING number is still signed out.
// The closing number is also USED, since the NotarizePaymentPlan or NotarizeMarketOffer call, but it
// remains ISSUED, until the final receipt itself is accepted during a process inbox.
//
theOriginator.RemoveIssuedNum(*pServerNym, strServerID, lSenderOpeningNumber, false); //bSave=false
theOriginator.SaveSignedNymfile(*pServerNym);
// ------------------------------------
OTPseudonym * pActualNym = NULL; // use this. DON'T use theActualNym.
OTPseudonym theActualNym; // unused unless it's really not already loaded. (use pActualNym.)
const OTIdentifier ACTUAL_NYM_ID = GetSenderUserID();
if ( (NULL != pServerNym) && pServerNym->CompareID(ACTUAL_NYM_ID) )
pActualNym = pServerNym;
else if (theOriginator.CompareID(ACTUAL_NYM_ID))
pActualNym = &theOriginator;
else if ( (NULL != pRemover) && pRemover->CompareID(ACTUAL_NYM_ID) )
pActualNym = pRemover;
// --------------------------
else // We couldn't find the Nym among those already loaded--so we have to load
{ // it ourselves (so we can update its NymboxHash value.)
theActualNym.SetIdentifier(ACTUAL_NYM_ID);
if (false == theActualNym.LoadPublicKey()) // Note: this step may be unnecessary since we are only updating his Nymfile, not his key.
{
OTString strNymID(ACTUAL_NYM_ID);
OTLog::vError("OTAgreement::onFinalReceipt: Failure loading public key for Nym: %s. "
"(To update his NymboxHash.) \n", strNymID.Get());
}