135 #include "../core/OTLog.hpp"
154 otOut <<
"Missing parameter: --";
156 for (
auto elem : theObjectNameAsStr) {
157 otOut << tolower(elem, loc);
192 if (10 > strMessage.length()) {
193 otWarn <<
"VerifyMessage: Error strMessage is: Too Short:" << strMessage
209 otOut <<
"VerifyMessageSuccess: Error calling "
210 "OT_API_Message_GetSuccess, for message:\n\n" << strMessage
214 otWarn <<
"VerifyMessageSuccess: Reply received: success == FALSE. "
215 "Reply message:\n\n" << strMessage <<
"\n";
218 otWarn <<
"VerifyMessageSuccess: Reply received: success == TRUE.\n";
221 otOut <<
"VerifyMessageSuccess: Error. (This should never happen!) "
222 "nStatus: " << nStatus <<
", Input: " << strMessage <<
"\n";
231 const string& SERVER_ID,
const string& USER_ID,
const string& ACCOUNT_ID,
232 const string& strMessage)
239 SERVER_ID, USER_ID, ACCOUNT_ID, strMessage);
242 otOut <<
"VerifyMsgBalanceAgrmntSuccess: Error calling "
243 "OT_API_Msg_GetBlnceAgrmntSuccess, for message:\n\n"
244 << strMessage <<
"\n";
247 otWarn <<
"VerifyMsgBalanceAgrmntSuccess: Reply received: success == "
248 "FALSE. Reply message:\n\n" << strMessage <<
"\n";
251 otWarn <<
"VerifyMsgBalanceAgrmntSuccess: Reply received: success == "
255 otOut <<
"VerifyMsgBalanceAgrmntSuccess: Error. (This should never "
256 "happen!) Input: " << strMessage <<
"\n";
266 const string& ACCOUNT_ID,
const string& strMessage)
273 SERVER_ID, USER_ID, ACCOUNT_ID, strMessage);
276 otOut <<
"VerifyMsgTrnxSuccess: Error calling "
277 "OT_API_Message_GetSuccess, for message:\n\n" << strMessage
281 otWarn <<
"VerifyMsgTrnxSuccess: Reply received: success == FALSE. "
282 "Reply message:\n\n" << strMessage <<
"\n";
285 otWarn <<
"VerifyMsgTrnxSuccess: Reply received: success == TRUE.\n";
288 otOut <<
"VerifyMsgTrnxSuccess: Error. (This should never happen!) "
289 "Input: " << strMessage <<
"\n";
301 const string& USER_ID,
302 const string& ACCOUNT_ID,
303 const string& strAttempt,
304 const string& strResponse)
307 if (-1 == nMessageSuccess) {
308 otOut <<
"Message error: " << strAttempt <<
".\n";
311 if (0 == nMessageSuccess) {
312 otOut <<
"Server reply (" << strAttempt <<
"): Message failure.\n";
318 SERVER_ID, USER_ID, ACCOUNT_ID, strResponse);
319 if (-1 == nBalanceSuccess) {
320 otOut <<
"Balance agreement error: " << strAttempt <<
".\n";
323 if (0 == nBalanceSuccess) {
324 otOut <<
"Server reply (" << strAttempt
325 <<
"): Balance agreement failure.\n";
329 int32_t nTransSuccess =
331 if (-1 == nTransSuccess) {
332 otOut <<
"Transaction error: " << strAttempt <<
".\n";
335 if (0 == nTransSuccess) {
336 otOut <<
"Server reply (" << strAttempt <<
"): Transaction failure.\n";
443 strLastReplyReceived =
"";
470 max_trans_dl = new_trans_dl;
475 return strLastReplyReceived;
480 strLastReplyReceived = strReply;
486 bool bWasSent =
false;
487 return getNymboxLowLevel(serverID, nymID, bWasSent);
498 string strLocation =
"Utility::getNymboxLowLevel";
505 if (-2 == nRequestNum) {
506 otOut << strLocation <<
": ERROR, not supported. (-2 was returned.)\n";
511 if (-1 == nRequestNum) {
513 <<
": Failed to send getNymbox message due to error.\n";
516 if (0 == nRequestNum) {
517 otOut << strLocation <<
": Unexpectedly returned 0. Didn't send "
518 "getNymbox message, but NO error occurred, "
519 "either. (In this case, SHOULD NEVER HAPPEN. "
520 "Treating as Error.)\n";
525 if (nRequestNum < 0) {
526 otOut << strLocation <<
": Unexpected request number: " << nRequestNum
535 receiveReplySuccessLowLevel(serverID, nymID, nRequestNum, strLocation);
600 bool bForceDownload =
false;
601 return getNymbox(serverID, nymID, bForceDownload);
608 string strLocation =
"Utility::getNymbox";
613 otOut << strLocation <<
": Warning: Unable to retrieve recent cached "
614 "copy of server-side NymboxHash from "
615 "client-side nym (perhaps he's never "
616 "downloaded it before?)\n\n";
622 otOut << strLocation <<
": Warning: Unable to retrieve client-side "
623 "NymboxHash for:\n serverID: " << serverID
624 <<
"\n nymID: " << nymID <<
"\n";
627 if (!bForceDownload) {
628 if (bLocalHash && bRecentHash &&
629 (strRecentHash == strLocalHash))
634 <<
": The hashes already match (skipping Nymbox download.)\n";
641 bool bWasMsgSent =
false;
642 int32_t nGetNymbox = getNymboxLowLevel(
643 serverID, nymID, bWasMsgSent);
646 <<
": FYI: we just sent a getNymboxLowLevel msg. RequestNum: "
647 << nGetNymbox <<
"\n";
650 if (!(bWasMsgSent) || ((nGetNymbox <= 0) && (-1 != nGetNymbox))) {
652 <<
": Failure: this.getNymboxLowLevel returned unexpected value: "
653 << nGetNymbox <<
"\n";
661 <<
": FYI: this.getNymboxLowLevel returned -1. (Re-trying...)\n";
663 int32_t nGetRequest = getRequestNumber(serverID, nymID);
664 if (1 != nGetRequest) {
665 otOut << strLocation <<
": Failure: this.getNymboxLowLevel failed, "
666 "then I tried to resync with "
667 "this.getRequestNumber and then that "
668 "failed too. (I give up.)\n";
672 string strLastReplyReceived = getLastReplyReceived();
677 otOut << strLocation <<
": ERROR in getLastReplyReceived(): why "
678 "was this string not set, when "
679 "this.getRequestNumber was otherwise an "
680 "apparent success?\n";
740 string strServerHash =
745 <<
": Warning: Unable to retrieve server-side NymboxHash "
746 "from server @getRequest reply:\n\n"
747 << strLastReplyReceived <<
"\n";
754 <<
": Warning(2): Unable to retrieve client-side NymboxHash "
755 "for:\n serverID: " << serverID <<
"\n nymID: " << nymID
761 if (bForceDownload || !bLocalHash || !bServerHash ||
762 (bServerHash && bLocalHash && !(strServerHash == strLocalHash))) {
766 nGetNymbox = getNymboxLowLevel(serverID, nymID, bWasMsgSent);
768 if (!(bWasMsgSent) || ((nGetNymbox <= 0) && (-1 != nGetNymbox))) {
770 <<
": Failure(2): this.getNymboxLowLevel returned "
771 "unexpected value: " << nGetNymbox <<
"\n";
775 if (-1 == nGetNymbox)
778 otOut << strLocation <<
": Failure: this.getNymboxLowLevel "
779 "returned -1, even after syncing the "
780 "request number successfully. (Giving "
868 const string& serverID,
const string& nymID,
bool& bWasMsgSent,
869 bool bForceDownload, int32_t nRequestNumber,
bool& bFoundNymboxItem,
870 bool bHarvestingForRetry,
const OTfourbool& bMsgFoursome)
872 string strLocation =
"Utility::getAndProcessNymbox";
874 bool bMsgReplySuccess = bMsgFoursome[0];
875 bool bMsgReplyFailure = bMsgFoursome[1];
876 bool bMsgTransSuccess = bMsgFoursome[2];
877 bool bMsgTransFailure = bMsgFoursome[3];
879 if (0 > nRequestNumber) {
880 otOut <<
"\n\n\n\n Failed verifying nRequestNumber as an integer. "
885 if (1 == nRequestNumber) {
887 <<
": WARNING: Request Num of '1' was just passed in here.\n";
935 int32_t nGetNymbox = getNymbox(serverID, nymID, bForceDownload);
936 if (nGetNymbox < 1) {
938 <<
": Failure: this.getNymbox returned: " << nGetNymbox <<
"\n";
982 int32_t nBoxType = 0;
984 bool bInsured = insureHaveAllBoxReceipts(
985 serverID, nymID, nymID, nBoxType, nRequestNumber,
990 if (nRequestNumber > 0) {
1000 if (bFoundNymboxItem) {
1011 int64_t(nRequestNumber), serverID, nymID);
1013 <<
": OT_API_RemoveSentMessage: (Found server reply in "
1014 "Nymbox. Removing local sent msg.) Request number: "
1015 << nRemovedMsg <<
"\n";
1022 <<
": FYI: Calling OT_API_GetSentMessage...\n";
1025 int64_t(nRequestNumber), serverID, nymID);
1029 <<
": (1) OT_API_GetSentMessage returned nullptr "
1030 "for clawback. (Must have already been cleared. "
1031 "OT uses deliberate redundancy, though optimizes "
1032 "this wherever possible.) Request number: "
1033 << nRequestNumber <<
"\n";
1037 otOut << strLocation <<
": FYI: Harvesting transaction "
1038 "numbers from failed Msg "
1043 bHarvestingForRetry,
1054 otOut << strLocation
1055 <<
": OT_API_Msg_HarvestTransactionNumbers: "
1056 << nHarvested <<
"\n";
1059 int64_t(nRequestNumber), serverID, nymID);
1061 <<
": OT_API_RemoveSentMessage: " << nRemovedMsg
1113 serverID, nymID, strNymbox);
1130 otOut << strLocation
1131 <<
": Error while trying to flush sent messages: Failed "
1132 "loading Nymbox for nym: " << nymID <<
"\n";
1135 int32_t nMsgSentRequestNumOut = -1;
1136 int32_t nReplySuccessOut = -1;
1137 int32_t nBalanceSuccessOut = -1;
1138 int32_t nTransSuccessOut = -1;
1151 int32_t nProcess = processNymbox(
1152 serverID, nymID, bWasMsgSent, nMsgSentRequestNumOut,
1153 nReplySuccessOut, nBalanceSuccessOut, nTransSuccessOut);
1155 if (-1 == nProcess) {
1160 otOut << strLocation <<
": Failure: processNymbox: error (-1). (It "
1161 "couldn't send. I give up.)\n";
1165 else if (0 == nProcess) {
1176 else if (nProcess < 0) {
1177 otOut << strLocation
1178 <<
": Failure: processNymbox: unexpected: " << nProcess
1179 <<
". (I give up.)\n";
1192 nProcess = nMsgSentRequestNumOut;
1194 int32_t nReplySuccess = nReplySuccessOut;
1195 int32_t nTransSuccess = nTransSuccessOut;
1196 int32_t nBalanceSuccess = nBalanceSuccessOut;
1215 string strReplyProcess = getLastReplyReceived();
1220 otOut << strLocation <<
": ERROR in getLastReplyReceived(): why "
1221 "was this string not set, when "
1222 "getRequestNumber was otherwise an "
1223 "apparent success?\n";
1229 bool bProcessNymboxReplyError =
1231 bool bProcessNymboxBalanceError =
1233 bool bProcessNymboxTransError =
1236 bool bProcessNymboxReplySuccess =
1237 (!bProcessNymboxReplyError && (nReplySuccess > 0));
1238 bool bProcessNymboxReplyFailure =
1239 (!bProcessNymboxReplyError && (nReplySuccess == 0));
1241 bool bProcessNymboxBalanceSuccess =
1242 (!bProcessNymboxReplyError && !bProcessNymboxBalanceError &&
1243 (nBalanceSuccess > 0));
1244 bool bProcessNymboxBalanceFailure =
1245 (!bProcessNymboxReplyError && !bProcessNymboxBalanceError &&
1246 (nBalanceSuccess == 0));
1248 bool bProcessNymboxTransSuccess =
1249 (!bProcessNymboxReplyError && !bProcessNymboxBalanceError &&
1250 !bProcessNymboxTransError && (nTransSuccess > 0));
1251 bool bProcessNymboxTransFailure =
1252 (!bProcessNymboxReplyError && !bProcessNymboxBalanceError &&
1253 !bProcessNymboxTransError && (nTransSuccess == 0));
1255 bool bProcessAnyError =
1256 (bProcessNymboxReplyError || bProcessNymboxBalanceError ||
1257 bProcessNymboxTransError);
1258 bool bProcessAnyFailure =
1259 (bProcessNymboxReplyFailure || bProcessNymboxBalanceFailure ||
1260 bProcessNymboxTransFailure);
1261 bool bProcessAllSuccess =
1262 (bProcessNymboxReplySuccess && bProcessNymboxBalanceSuccess &&
1263 bProcessNymboxTransSuccess);
1290 int32_t nHarvested = -1;
1292 if (bProcessAllSuccess) {
1312 else if (bProcessAnyError ||
1317 nGetNymbox = getNymbox(serverID, nymID,
1322 if (nGetNymbox < 1) {
1323 otOut << strLocation
1324 <<
": Failure: this.getNymbox returned: " << nGetNymbox
1330 bool bWasFound =
false;
1337 if (insureHaveAllBoxReceipts(serverID, nymID, nymID, nBoxType,
1338 nProcess, bWasFound))
1365 otOut << strLocation <<
": FYI: I *did* find the "
1366 "@processNymbox reply in my "
1367 "Nymbox, so NO NEED to clawback "
1368 "any transaction numbers.\n";
1387 <<
": FYI: Calling OT_API_GetSentMessage...\n";
1390 int64_t(nProcess), serverID, nymID);
1394 <<
": (2) OT_API_GetSentMessage returned "
1395 "nullptr for clawback. (Must have already "
1396 "been cleared. OT uses deliberate "
1397 "redundancy, though optimizes this wherever "
1398 "possible.) Request number: " << nProcess
1403 otOut << strLocation <<
": FYI: Harvesting transaction "
1404 "numbers from failed "
1405 "processNymbox attempt...\n";
1408 strSentProcessNymboxMsg, nymID,
1410 bProcessNymboxReplySuccess,
1414 bProcessNymboxReplyFailure,
1418 bProcessNymboxTransSuccess,
1422 bProcessNymboxTransFailure);
1427 otOut << strLocation
1428 <<
": OT_API_Msg_HarvestTransactionNumbers: "
1429 << nHarvested <<
"\n";
1431 bool nRemovedProcessNymboxMsg =
1435 otInfo << strLocation <<
": OT_API_RemoveSentMessage: "
1436 << nRemovedProcessNymboxMsg <<
"\n";
1447 serverID, nymID, strNymbox);
1467 otOut << strLocation <<
": Error while trying to flush "
1468 "sent messages: Failed loading "
1469 "Nymbox for nym: " << nymID <<
"\n";
1474 otOut << strLocation <<
": Error: insureHaveAllBoxReceipts "
1475 "failed. (I give up.)\n";
1485 if (bProcessAllSuccess)
1494 if (bProcessAnyFailure || bProcessAnyError) {
1502 if (bProcessAnyFailure) {
1511 otOut << strLocation
1512 <<
": insureHaveAllBoxReceipts failed. (I give up.)\n";
1523 bool& bWasMsgSent,
bool bForceDownload)
1525 string strLocation =
"Utility::getAndProcessNymbox_4";
1528 otOut << strLocation <<
": SHOULD NEVER HAPPEN!!! ASSERT!! ERROR!! "
1529 "FAILURE!!! PROBLEM!!!!!\n";
1537 int32_t nRequestNumber = 0;
1538 bool bHarvestingForRetry =
false;
1539 OTfourbool the_foursome = {
false,
false,
false,
false};
1540 bool bFoundNymboxItem =
false;
1543 return getAndProcessNymbox_8(serverID, nymID, bWasMsgSent, bForceDownload,
1544 nRequestNumber, bFoundNymboxItem,
1545 bHarvestingForRetry, the_foursome);
1556 const string& nymID,
1559 bool bForceDownload =
false;
1560 return getAndProcessNymbox_4(serverID, nymID, bWasMsgSent, bForceDownload);
1586 bool& bWasMsgSent, int32_t& nMsgSentRequestNumOut,
1587 int32_t& nReplySuccessOut,
1588 int32_t& nBalanceSuccessOut,
1589 int32_t& nTransSuccessOut)
1591 bWasMsgSent =
false;
1592 string strLocation =
"Utility::processNymbox";
1604 nMsgSentRequestNumOut = -1;
1605 nReplySuccessOut = -1;
1606 nBalanceSuccessOut = -1;
1607 nTransSuccessOut = -1;
1614 int32_t nProcess = sendProcessNymboxLowLevel(
1616 if (-1 == nProcess) {
1617 otOut << strLocation <<
"(2): error (-1), when calling "
1618 "sendProcessNymboxLowLevel. (It couldn't send. "
1624 if (0 == nProcess) {
1628 otOut << strLocation <<
": unexpected: " << nProcess
1629 <<
", when calling sendProcessNymboxLowLevel. (I give up.)\n";
1634 nMsgSentRequestNumOut = nProcess;
1642 string strReplyProcess =
1643 ReceiveReplyLowLevel(serverID, nymID, nProcess,
1644 "processNymbox / sendProcessNymboxLowLevel / "
1645 "ReceiveReplyLowLevel");
1655 int32_t nReplySuccess =
1657 int32_t nTransSuccess = -1;
1658 int32_t nBalanceSuccess = -1;
1660 if (nReplySuccess > 0)
1664 serverID, nymID, nymID,
1666 if (nBalanceSuccess > 0) {
1668 serverID, nymID, nymID,
1673 nReplySuccessOut = nReplySuccess;
1674 nBalanceSuccessOut = nBalanceSuccess;
1675 nTransSuccessOut = nTransSuccess;
1680 if (nTransSuccess > 0) {
1684 return nTransSuccess;
1695 const string& serverID,
const string& nymID)
const
1699 string strLocation =
"Utility::sendProcessNymboxLowLevel";
1705 if (-1 == nRequestNum) {
1706 otOut << strLocation
1707 <<
": Failure sending. OT_API_processNymbox() returned -1. \n";
1710 if (nRequestNum < 0) {
1711 otOut << strLocation
1712 <<
": Failure: OT_API_processNymbox() returned unexpected value: "
1713 << nRequestNum <<
"\n";
1716 if (0 == nRequestNum) {
1717 otOut << strLocation <<
": Nymbox was empty; no need to process it. \n";
1738 const string& nymID,
1739 int32_t nRequestNumber7,
1740 const string& IN_FUNCTION)
1742 string strReply = ReceiveReplyLowLevel(
1743 serverID18, nymID, nRequestNumber7,
1744 "receiveReplySuccessLowLevel: " +
1765 const string& nymID,
1766 int32_t nRequestNumber8,
1767 const string& IN_FUNCTION)
1770 setLastReplyReceived(
"");
1772 if (0 > nRequestNumber8) {
1773 otOut <<
"ReceiveReplyLowLevel (" << IN_FUNCTION
1774 <<
"): nRequestNumber isn't a valid number.\n";
1779 int64_t(nRequestNumber8), serverID17, nymID);
1781 otOut <<
"ReceiveReplyLowLevel (" << IN_FUNCTION
1782 <<
"): null server reply!\n";
1785 setLastReplyReceived(strResponseMessage);
1787 return strResponseMessage;
1793 bool bWasSent =
false;
1794 return getRequestNumber(serverID, nymID, bWasSent);
1813 string strLocation =
"Utility::getRequestNumber";
1820 otOut << strLocation
1821 <<
": Failed to send getRequest message due to error.\n";
1828 otOut << strLocation <<
": Didn't send this getRequest message, but NO "
1829 "error occurred, either. (Should never "
1847 receiveReplySuccessLowLevel(serverID, nymID, nResult, strLocation);
1879 const string& serverID,
const string& nymID,
const string& accountID,
1880 int32_t nBoxType, int64_t strTransactionNum,
1883 string strLocation =
"Utility::getBoxReceiptLowLevel";
1890 serverID, nymID, accountID, nBoxType,
1892 if (-2 == nRequestNum) {
1893 otOut << strLocation <<
": ERROR, not supported. (-2 was returned.)\n";
1899 if (-1 == nRequestNum) {
1900 otOut << strLocation
1901 <<
": Failed to send getNymbox message due to error.\n";
1904 if (0 == nRequestNum) {
1905 otOut << strLocation <<
": Didn't send getNymbox message, but NO error "
1906 "occurred, either. (In this case, SHOULD NEVER "
1907 "HAPPEN. Treating as Error.)\n";
1912 if (nRequestNum < 0) {
1913 otOut << strLocation <<
": Unexpected request number: " << nRequestNum
1927 receiveReplySuccessLowLevel(serverID, nymID, nRequestNum, strLocation);
1928 otWarn << strLocation <<
": nRequestNum: " << nRequestNum
1929 <<
" / nReturn: " << nReturn <<
"\n";
1952 otOut << strLocation <<
": Failure: Response from server:\n"
1953 << getLastReplyReceived() <<
"\n";
1960 const string& serverID,
const string& nymID,
const string& accountID,
1961 int32_t nBoxType, int64_t strTransactionNum)
1963 string strLocation =
"Utility::getBoxReceiptWithErrorCorrection";
1965 bool bWasSent =
false;
1966 bool bWasRequestSent =
false;
1968 if (getBoxReceiptLowLevel(serverID, nymID, accountID, nBoxType,
1969 strTransactionNum, bWasSent)) {
1972 if (bWasSent && (1 == getRequestNumber(serverID, nymID,
1979 if (bWasRequestSent &&
1980 getBoxReceiptLowLevel(serverID, nymID, accountID, nBoxType,
1981 strTransactionNum, bWasSent)) {
1984 otOut << strLocation <<
": getBoxReceiptLowLevel failed, then "
1985 "getRequestNumber succeeded, then "
1986 "getBoxReceiptLowLevel failed again. (I give "
1990 otOut << strLocation <<
": getBoxReceiptLowLevel failed, then "
1991 "getRequestNumber failed. (I give up.) Was "
1992 "getRequest message sent: " << bWasRequestSent
2006 const string& serverID,
const string& nymID,
const string& accountID,
2009 bool bFoundIt =
false;
2010 int32_t nRequestSeeking = 0;
2011 return insureHaveAllBoxReceipts(serverID, nymID, accountID, nBoxType,
2012 nRequestSeeking, bFoundIt);
2016 const string& serverID,
const string& nymID,
const string& accountID,
2017 int32_t nBoxType, int32_t nRequestSeeking,
bool& bFoundIt)
2019 string strLocation =
"Utility::insureHaveAllBoxReceipts";
2023 if (0 == nBoxType) {
2026 else if (1 == nBoxType) {
2029 else if (2 == nBoxType) {
2033 otOut << strLocation <<
": Error. Expected nBoxType of 0,1,2 (nymbox, "
2034 "inbox, or outbox.)\n";
2049 otOut << strLocation <<
": Unable to load or verify signature on "
2050 "ledger. (Failure.) Contents:\n" << ledger
2062 bool bReturnValue =
true;
2064 int32_t nReceiptCount =
2066 if (nReceiptCount > 0) {
2067 for (int32_t i_loop = 0; i_loop < nReceiptCount; ++i_loop) {
2068 int64_t lTransactionNum =
2070 serverID, nymID, accountID, ledger, i_loop);
2071 if (lTransactionNum != -1) {
2072 if (lTransactionNum > 0) {
2073 string strTransaction =
2089 otOut << strLocation
2090 <<
": Error: Null transaction somehow returned, "
2091 "(not even an abbreviated one!) even though I "
2092 "had a good ID " << lTransactionNum
2093 <<
" which came originally as lTransactionNum: "
2094 << lTransactionNum <<
" for index: " << i_loop
2095 <<
" with the contents:\n\n" << strTransaction
2108 serverID, nymID, accountID, strTransaction);
2110 (strTransType ==
"replyNotice"));
2111 int64_t lRequestNum = 0;
2112 if (bIsReplyNotice) {
2114 serverID, nymID, strTransaction);
2117 bool bShouldDownload =
2119 (bIsReplyNotice && (0 < lRequestNum) &&
2123 if (bShouldDownload)
2128 bool bHaveBoxReceipt =
2130 serverID, nymID, accountID, nBoxType,
2132 if (!bHaveBoxReceipt) {
2133 otWarn << strLocation <<
": Downloading box "
2134 "receipt to add to my "
2138 getBoxReceiptWithErrorCorrection(
2139 serverID, nymID, accountID, nBoxType,
2144 <<
": Failed downloading box receipt. "
2145 "(Skipping any others.) Transaction "
2146 "number: " << lTransactionNum
2149 bReturnValue =
false;
2171 <<
": Error: TransactionNum less-than-or-equal-to 0.\n";
2175 otOut << strLocation <<
": Error: TransactionNum was null, "
2176 "when trying to read it based on the "
2177 "index (within bounds, too!)\n";
2188 if ((nRequestSeeking > 0) && (0 == nBoxType)) {
2343 serverID, nymID, int64_t(nRequestSeeking));
2350 return bReturnValue;
2375 const string& nymID,
2378 string strLocation =
"Utility::getTransactionNumLowLevel";
2385 if (-2 == nRequestNum) {
2386 otOut << strLocation <<
": ERROR, not supported. (-2 was returned.)\n";
2391 if (-1 == nRequestNum) {
2392 otOut << strLocation
2393 <<
": Failed to send getNymbox message due to error.\n";
2396 if (0 == nRequestNum) {
2397 otOut << strLocation <<
": Unexpectedly returned 0. Didn't send "
2398 "getTransactionNum message, but NO error "
2399 "occurred, either. (In this case, SHOULD NEVER "
2400 "HAPPEN. Treating as Error.)\n";
2405 if (nRequestNum < 0) {
2406 otOut << strLocation <<
": Unexpected request number: " << nRequestNum
2414 int32_t nReturn = receiveReplySuccessLowLevel(serverID, nymID, nRequestNum,
2415 "getTransactionNum");
2481 const string& nymID)
2483 return getTransactionNumbers(serverID, nymID,
true);
2491 const string& serverID,
const string& nymID,
2492 bool bForceFirstCall)
2494 string strLocation =
"Utility::getTransactionNumbers";
2496 bool bWasSent =
false;
2497 int32_t nGetNumbers = -1;
2498 if (bForceFirstCall) {
2499 nGetNumbers = getTransactionNumLowLevel(
2500 serverID, nymID, bWasSent);
2506 if (!bForceFirstCall || (bWasSent && (nGetNumbers >= 1)) ||
2507 (!bWasSent && (nGetNumbers == 0))) {
2511 bool bForceDownload =
true;
2512 int32_t nProcess = getAndProcessNymbox_4(
2513 serverID, nymID, bWasSent, bForceDownload);
2515 if ((bWasSent && (1 == nProcess)) || (!bWasSent && (0 == nProcess))) {
2522 else if ((nGetNumbers < -1) || !bWasSent) {
2523 otOut << strLocation <<
": Failure: getTransactionNumLowLevel returned "
2524 "unexpected value: " << nGetNumbers <<
"\n";
2536 else if ((-1 == nGetNumbers) || (0 == nGetNumbers)) {
2537 if (-1 == nGetNumbers) {
2538 otOut << strLocation <<
": FYI: getTransactionNumLowLevel did "
2539 "send, but returned error (-1). "
2542 else if (0 == nGetNumbers) {
2543 otOut << strLocation <<
": FYI: getTransactionNumLowLevel did "
2544 "send, but returned failure (0). "
2548 int32_t nGetRequest = getRequestNumber(serverID, nymID);
2549 if (1 != nGetRequest) {
2550 otOut << strLocation <<
": Failure: getTransactionNumLowLevel "
2551 "failed, then I tried to resync with "
2552 "getRequestNumber and then that failed "
2553 "too. (I give up.)\n";
2558 bool bWasProcessSent =
false;
2559 bool bForceDownload =
true;
2560 int32_t nProcessNymbox = getAndProcessNymbox_4(
2561 serverID, nymID, bWasProcessSent,
2570 if ((!bWasProcessSent &&
2571 ((nProcessNymbox < 0) || (nProcessNymbox > 1))) ||
2572 (bWasProcessSent && (nProcessNymbox != 1))) {
2588 if (bWasProcessSent && (nProcessNymbox > 1)) {
2596 serverID, nymID, strNymbox);
2600 otOut << strLocation
2601 <<
": Failure: getAndProcessNymbox. Returned value: "
2602 << nProcessNymbox <<
"\n";
2607 nGetNumbers = getTransactionNumLowLevel(
2608 serverID, nymID, bWasSent);
2616 if ((bWasSent && (nGetNumbers >= 1)) ||
2617 (!bWasSent && (nGetNumbers == 0))) {
2618 bool bForceDownload =
true;
2620 getAndProcessNymbox_4(serverID, nymID, bWasSent,
2626 if ((bWasSent && (1 == nProcess)) ||
2627 (!bWasSent && (0 == nProcess))) {
2633 else if ((nGetNumbers < -1) || (!bWasSent && nGetNumbers != 0)) {
2634 otOut << strLocation <<
": Failure: getTransactionNumLowLevel "
2635 "returned unexpected value: " << nGetNumbers
2639 else if ((-1 == nGetNumbers) || (0 == nGetNumbers)) {
2640 if (-1 == nGetNumbers) {
2641 otOut << strLocation <<
": Failure: getTransactionNumLowLevel "
2642 "did send, but returned error (-1), "
2643 "even after syncing the request number "
2644 "successfully. (Giving up.)\n";
2646 else if (0 == nGetNumbers) {
2647 otOut << strLocation <<
": Failure: getTransactionNumLowLevel "
2648 "did send, but returned failure (0), "
2649 "even after syncing the request number "
2650 "successfully. (Giving up.)\n";
2653 bool bForceDownload =
true;
2655 int32_t nLast = getAndProcessNymbox_4(
2656 serverID, nymID, bWasProcessSent,
2665 if (((!bWasProcessSent) && ((nLast < 0) || (nLast > 1))) ||
2666 ((
true == bWasProcessSent) &&
2671 if (bWasProcessSent && (nLast > 1)) {
2679 serverID, nymID, strNymbox);
2683 otOut << strLocation
2684 <<
": Failure: getAndProcessNymbox. Returned value: "
2689 nGetNumbers = getTransactionNumLowLevel(
2690 serverID, nymID, bWasSent);
2697 if ((bWasSent && (nGetNumbers >= 1)) ||
2698 ((!bWasSent && (nGetNumbers == 0)))) {
2699 bool bForceDownload =
true;
2700 int32_t nProcess = getAndProcessNymbox_4(
2701 serverID, nymID, bWasSent,
2707 if ((bWasSent && (1 == nProcess)) ||
2708 (!bWasSent && (0 == nProcess))) {
2718 if ((nGetNumbers < -1) || !bWasSent) {
2719 otOut << strLocation
2720 <<
": Failure: getTransactionNumLowLevel returned "
2721 "unexpected value: " << nGetNumbers <<
"\n";
2735 string strLastReplyReceived = getLastReplyReceived();
2738 otOut << strLocation <<
": ERROR in getLastReplyReceived(): why was "
2739 "this string not set, when getRequestNumber "
2740 "was otherwise an apparent success?\n";
2751 string strServerHash =
2755 otOut << strLocation
2756 <<
": Warning: Unable to retrieve server-side NymboxHash from "
2757 "OT, from server @getTransactionNum reply:\n\n"
2758 << strLastReplyReceived <<
"\n";
2765 otOut << strLocation
2766 <<
": Warning: Unable to retrieve client-side NymboxHash from "
2767 "OT, for:\n serverID: " << serverID <<
"\n nymID: " << nymID
2775 if (!bServerhash || !bLocalhash ||
2776 (bServerhash && bLocalhash && !(strServerHash == strLocalHash))) {
2781 bool bWasProcessSent =
false;
2782 bool bForceDownload =
true;
2783 int32_t nGetNymbox = getAndProcessNymbox_4(
2784 serverID, nymID, bWasProcessSent,
2793 if (((!bWasProcessSent) && ((nGetNymbox < 0) || (nGetNymbox > 1))) ||
2794 ((
true == bWasProcessSent) && (nGetNymbox != 1))) {
2795 if (nGetNymbox > 1) {
2803 serverID, nymID, strNymbox);
2809 <<
": Failure: getAndProcessNymbox returned unexpected value: "
2810 << nGetNymbox <<
"\n";
2813 if (-1 == nGetNymbox)
2816 otOut << strLocation <<
": Failure: getAndProcessNymbox returned "
2817 "-1, even after syncing the request number "
2818 "successfully. (Giving up.)\n";
2827 const string& nymID,
2828 const string& accountID)
2830 bool bForceDownload =
false;
2831 return getIntermediaryFiles(serverID, nymID, accountID, bForceDownload);
2836 const string& serverID,
const string& nymID,
const string& accountID,
2837 bool bForceDownload)
2839 string strLocation =
"Utility::getIntermediaryFiles_old";
2842 otOut << strLocation <<
": nullptr or invalid serverID.\n";
2846 otOut << strLocation <<
": nullptr or invalid nymID.\n";
2850 otOut << strLocation <<
": nullptr or invalid accountID.\n";
2854 bool bWasSentInbox =
false;
2855 bool bWasSentAccount =
false;
2857 int32_t nGetInboxAcct =
2858 getInboxAccount_old(serverID, nymID, accountID, bWasSentInbox,
2859 bWasSentAccount, bForceDownload);
2865 if ((-1 == nGetInboxAcct) && !bWasSentAccount) {
2866 otOut << strLocation <<
": getInboxAccount_old failed, without even "
2867 "sending getAccount. (Returning false.)\n";
2874 if (!bWasSentInbox && (0 == nGetInboxAcct)) {
2877 else if (1 != nGetInboxAcct) {
2878 otOut << strLocation
2879 <<
": getInboxAccount_old failed. (Trying one more time...)\n";
2881 int32_t nGetRequest = getRequestNumber(serverID, nymID);
2882 if (1 != nGetRequest) {
2883 otOut << strLocation <<
": Failure: getInboxAccount_old failed, "
2884 "then I tried to resync with "
2885 "getRequestNumber and then that failed "
2886 "too. (I give up.)\n";
2890 int32_t nSecondtry =
2891 getInboxAccount_old(serverID, nymID, accountID, bWasSentInbox,
2892 bWasSentAccount, bForceDownload);
2893 if ((-1 == nSecondtry) && !bWasSentAccount) {
2898 otOut << strLocation <<
": getInboxAccount_old failed a second "
2899 "time, without even sending getAccount. "
2900 "(Returning false.)\n";
2906 if (!bWasSentInbox && (0 == nSecondtry)) {
2909 else if (1 != nSecondtry) {
2910 otOut << strLocation <<
": getInboxAccount_old re-try failed. "
2911 "(That's twice now--Returning false.) "
2912 "Value: " << nSecondtry <<
"\n";
2917 <<
": getInboxAccount_old second call succeeded. (Continuing...)\n";
2920 bool bWasSentOutbox =
false;
2922 int32_t nGetOutbox = getOutboxLowLevel(serverID, nymID, accountID,
2923 bWasSentOutbox, bForceDownload);
2925 if (-1 == nGetOutbox && !bWasSentOutbox) {
2930 otOut << strLocation <<
": getOutboxLowLevel failed, without even "
2931 "sending getOutbox. (Returning false.)\n";
2937 if (!bWasSentOutbox && 0 == nGetOutbox) {
2941 if (1 != nGetOutbox) {
2942 otOut << strLocation
2943 <<
": getOutboxLowLevel failed. (Trying one more time...)\n";
2945 int32_t nGetRequest = getRequestNumber(serverID, nymID);
2946 if (1 != nGetRequest) {
2947 otOut << strLocation <<
": Failure: getOutboxLowLevel failed, then "
2948 "I tried to resync with getRequestNumber "
2949 "and then that failed too. (I give up.)\n";
2953 int32_t nSecondtry = getOutboxLowLevel(serverID, nymID, accountID,
2954 bWasSentOutbox, bForceDownload);
2955 if ((-1 == nSecondtry) && !bWasSentOutbox) {
2960 otOut << strLocation <<
": getOutboxLowLevel failed a second time, "
2961 "without even sending getOutbox. "
2962 "(Returning false.)\n";
2968 if (!bWasSentOutbox && (0 == nSecondtry)) {
2972 if (1 != nSecondtry) {
2973 otOut << strLocation <<
": getOutboxLowLevel re-try failed. "
2974 "(That's twice now--Returning false.) "
2975 "Value: " << nSecondtry <<
"\n";
2978 otOut << strLocation
2979 <<
": getOutboxLowLevel second call succeeded. (Continuing...)\n";
2988 const string& serverID,
const string& nymID,
const string& accountID,
2989 bool bForceDownload)
2991 string strLocation =
"Utility::getIntermediaryFiles";
2994 otOut << strLocation <<
": nullptr or invalid serverID.\n";
2998 otOut << strLocation <<
": nullptr or invalid nymID.\n";
3002 otOut << strLocation <<
": nullptr or invalid accountID.\n";
3006 bool bWasSentInbox =
false;
3007 bool bWasSentAccount =
false;
3012 int32_t nGetInboxAcct =
3013 getInboxAccount(serverID, nymID, accountID, bWasSentInbox,
3014 bWasSentAccount, bForceDownload);
3020 if (-1 == nGetInboxAcct) {
3021 if (!bWasSentAccount) {
3022 otOut << strLocation <<
": this.getInboxAccount failed, without "
3023 "even sending getAccountFiles. (Returning "
3032 else if (!bWasSentInbox && (0 == nGetInboxAcct)) {
3035 else if (1 != nGetInboxAcct) {
3036 otOut << strLocation
3037 <<
": getInboxAccount failed. (Trying one more time...)\n";
3039 int32_t nGetRequest = getRequestNumber(serverID, nymID);
3040 if (1 != nGetRequest) {
3041 otOut << strLocation <<
": Failure: getInboxAccount failed, then I "
3042 "tried to resync with getRequestNumber and "
3043 "then that failed too. (I give up.)\n";
3063 return getIntermediaryFiles_old(serverID, nymID, accountID,
3072 int32_t nSecondtry =
3073 getInboxAccount(serverID, nymID, accountID, bWasSentInbox,
3074 bWasSentAccount, bForceDownload);
3076 if ((-1 == nSecondtry) && !bWasSentAccount) {
3081 otOut << strLocation <<
": getInboxAccount failed a second time, "
3082 "without even sending getAccountFiles. "
3083 "(Returning false.)\n";
3089 if (!bWasSentInbox && (0 == nSecondtry)) {
3092 else if (1 != nSecondtry) {
3093 otOut << strLocation
3094 <<
": getInboxAccount re-try failed. (That's twice "
3095 "now--Returning false.) Value: " << nSecondtry <<
"\n";
3098 otOut << strLocation
3099 <<
": getInboxAccount second call succeeded. (Continuing...)\n";
3109 const string& accountID,
bool& bWasSentInbox,
3110 bool& bWasSentAccount,
const bool)
3112 string strLocation =
"Utility::getInboxAccount";
3114 bWasSentAccount =
false;
3115 bWasSentInbox =
false;
3127 serverID, nymID, accountID);
3128 if (-2 == nRequestNum) {
3129 otOut << strLocation <<
": ERROR, not supported. (-2 was returned.)\n";
3134 if (-1 == nRequestNum) {
3135 otOut << strLocation
3136 <<
": Failed to send getAccountFiles message due to error.\n";
3139 if (0 == nRequestNum) {
3140 otOut << strLocation <<
": Didn't send getAccountFiles message, but NO "
3141 "error occurred, either. (In this case, SHOULD "
3142 "NEVER HAPPEN. Treating as Error.)\n";
3145 if (nRequestNum < 0) {
3148 <<
": Unexpected failure sending getAccountFiles. Request number: "
3149 << nRequestNum <<
"\n";
3153 bWasSentAccount =
true;
3154 bWasSentInbox =
true;
3160 int32_t nReturn = receiveReplySuccessLowLevel(
3161 serverID, nymID, nRequestNum,
3165 otOut << strLocation <<
": Error in getAccountFiles: " << nReturn
3166 <<
". (I give up.)\n";
3198 otOut << strLocation
3199 <<
": getAccountFiles failed, returning: " << nReturn <<
"\n";
3204 if (!insureHaveAllBoxReceipts(serverID, nymID, accountID,
3207 otOut << strLocation <<
": getAccountFiles succeeded, but then "
3208 "insureHaveAllBoxReceipts failed on the inbox. "
3213 if (!insureHaveAllBoxReceipts(serverID, nymID, accountID,
3216 otOut << strLocation <<
": getAccountFiles succeeded, but then "
3217 "insureHaveAllBoxReceipts failed on the "
3218 "outbox. (I give up.)\n";
3230 bool bForceDownload =
false;
3231 return getInboxOutboxAccount(accountID, bForceDownload);
3235 const string& accountID,
3236 bool bForceDownload)
3238 string strLocation =
"Utility::getInboxOutboxAccount";
3241 otOut << strLocation <<
": invalid accountID: " << accountID <<
"\n";
3247 if (!getIntermediaryFiles(serverID, nymID, accountID, bForceDownload)) {
3248 otOut << strLocation <<
": getIntermediaryFiles failed. (Returning.)\n";
3284 const string& accountID,
bool& bWasSentInbox,
3285 bool& bWasSentAccount)
3287 bool bForceDownload =
false;
3288 return getInboxAccount(serverID, nymID, accountID, bWasSentInbox,
3289 bWasSentAccount, bForceDownload);
3295 const string& accountID,
bool& bWasSentInbox,
3296 bool& bWasSentAccount,
3297 bool bForceDownload)
3299 string strLocation =
"Utility::getInboxAccount_old";
3301 bWasSentAccount =
false;
3302 bWasSentInbox =
false;
3317 if ((-2) == nRequestNum) {
3318 otOut << strLocation <<
": ERROR, not supported. (-2 was returned.)\n";
3323 if (-1 == nRequestNum) {
3324 otOut << strLocation
3325 <<
": Failed to send getAccount message due to error.\n";
3328 if (0 == nRequestNum) {
3329 otOut << strLocation <<
": Didn't send getAccount message, but NO "
3330 "error occurred, either. (In this case, SHOULD "
3331 "NEVER HAPPEN. Treating as Error.)\n";
3334 if (nRequestNum < 0) {
3335 otOut << strLocation
3336 <<
": Unexpected failure sending getAccount(). Request number: "
3337 << nRequestNum <<
"\n";
3341 bWasSentAccount =
true;
3347 int32_t nReturn = receiveReplySuccessLowLevel(
3348 serverID, nymID, nRequestNum,
3354 bool bAccount = 1 == nReturn;
3382 otOut << strLocation <<
": Error in getAccount: " << nReturn
3383 <<
". (I give up.)\n";
3388 otOut << strLocation <<
": getAccount failed, returning: " << nReturn
3393 int32_t nReturn2 = getInboxLowLevel(serverID, nymID, accountID,
3394 bWasSentInbox, bForceDownload);
3399 if (!bWasSentInbox && (0 == nReturn2)) {
3403 if (1 != nReturn2) {
3404 otOut << strLocation
3405 <<
": getInboxLowLevel failed. Returning: " << nReturn2 <<
"\n";
3421 const string& accountID,
bool& bWasSent)
3423 bool bForceDownload =
false;
3424 return getInboxLowLevel(serverID, nymID, accountID, bWasSent,
3431 const string& accountID,
bool& bWasSent,
3434 string strLocation =
"Utility::getInboxLowLevel";
3445 otOut << strLocation <<
": Warning: Unable to retrieve recent cached "
3446 "copy of server-side InboxHash from "
3447 "client-side nym (perhaps he's never "
3448 "downloaded it before?)\n\n";
3459 otOut << strLocation <<
": Warning: Unable to retrieve client-side "
3460 "InboxHash for:\n accountID: " << accountID
3461 <<
"\n nymID: " << nymID <<
"\n";
3467 if (bLocalHash && bRecentHash && (strRecentHash == strLocalHash)) {
3469 <<
": The hashes already match (skipping Inbox download.)\n";
3482 if ((-2) == nRequestNum) {
3483 otOut << strLocation <<
": ERROR, not supported. (-2 was returned.)\n";
3488 if (-1 == nRequestNum)
3491 otOut << strLocation
3492 <<
": Failed to send getInbox message due to error.\n";
3495 if (0 == nRequestNum) {
3496 otOut << strLocation <<
": Didn't send getInbox message, but NO error "
3497 "occurred, either. (In this case, SHOULD NEVER "
3498 "HAPPEN. Treating as Error.)\n";
3503 if (nRequestNum < 0) {
3504 otOut << strLocation <<
": Unexpected request number: " << nRequestNum
3514 receiveReplySuccessLowLevel(serverID, nymID, nRequestNum, strLocation);
3518 bool bInbox = 1 == nReturn;
3548 int32_t nBoxType = 1;
3550 !insureHaveAllBoxReceipts(serverID, nymID, accountID,
3553 otOut << strLocation <<
": getInbox succeeded, but then "
3554 "insureHaveAllBoxReceipts failed. (I give "
3572 const string& accountID,
bool& bWasSent)
3574 bool bForceDownload =
false;
3575 return getOutboxLowLevel(serverID, nymID, accountID, bWasSent,
3584 const string& accountID,
bool& bWasSent,
3589 string strLocation =
"Utility::getOutboxLowLevel";
3598 otOut << strLocation <<
": Warning: Unable to retrieve recent cached "
3599 "copy of server-side OutboxHash from "
3600 "client-side nym (perhaps he's never "
3601 "downloaded it before?)\n\n";
3612 otOut << strLocation <<
": Warning: Unable to retrieve client-side "
3613 "OutboxHash for:\n accountID: " << accountID
3614 <<
"\n nymID: " << nymID <<
"\n";
3618 if (bLocalHash && bRecentHash &&
3619 (strRecentHash == strLocalHash))
3624 <<
": The hashes already match (skipping Outbox download.)\n";
3636 if (-2 == nRequestNum) {
3637 otOut << strLocation <<
": ERROR, not supported. (-2 was returned.)\n";
3642 if (-1 == nRequestNum)
3645 otOut << strLocation
3646 <<
": Failed to send getOutbox message due to error.\n";
3649 if (0 == nRequestNum) {
3650 otOut << strLocation <<
": Didn't send getOutbox message, but NO error "
3651 "occurred, either. (In this case, SHOULD NEVER "
3652 "HAPPEN. Treating as Error.)\n";
3657 if (nRequestNum < 0) {
3658 otOut << strLocation <<
": Unexpected request number: " << nRequestNum
3668 receiveReplySuccessLowLevel(serverID, nymID, nRequestNum, strLocation);
3672 bool bOutbox = 1 == nReturn;
3702 int32_t nBoxType = 2;
3704 !insureHaveAllBoxReceipts(serverID, nymID, accountID,
3707 otOut << strLocation <<
": getOutbox succeeded, but then "
3708 "insureHaveAllBoxReceipts failed. (I give "
EXPORT OT_UTILITY_OT int32_t getAndProcessNymbox_3(const std::string &serverID, const std::string &nymID, bool &bWasMsgSent)
EXPORT OT_UTILITY_OT int32_t getNymbox(const std::string &serverID, const std::string &nymID)
static EXPORT std::string GetAccountWallet_NymID(const std::string &ACCOUNT_ID)
static EXPORT std::string LoadOutboxNoVerify(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID)
static EXPORT std::string GetNym_InboxHash(const std::string &ACCOUNT_ID, const std::string &NYM_ID)
static EXPORT std::string GetSentMessage(const int64_t &REQUEST_NUMBER, const std::string &SERVER_ID, const std::string &USER_ID)
static EXPORT bool DoesBoxReceiptExist(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const int32_t &nBoxType, const int64_t &TRANSACTION_NUMBER)
EXPORT OT_UTILITY_OT int32_t getOutboxLowLevel(const std::string &serverID, const std::string &nymID, const std::string &accountID, bool &bWasSent)
EXPORT OT_UTILITY_OT int32_t getNbrTransactionCount() const
EXPORT OT_UTILITY_OT bool getBoxReceiptWithErrorCorrection(const std::string &serverID, const std::string &nymID, const std::string &accountID, int32_t nBoxType, int64_t strTransactionNum)
EXPORT OT_UTILITY_OT bool getBoxReceiptLowLevel(const std::string &serverID, const std::string &nymID, const std::string &accountID, int32_t nBoxType, int64_t strTransactionNum, bool &bWasSent)
EXPORT OT_UTILITY_OT int32_t getAndProcessNymbox_4(const std::string &serverID, const std::string &nymID, bool &bWasMsgSent, bool bForceDownload)
static EXPORT int32_t Message_GetSuccess(const std::string &THE_MESSAGE)
static EXPORT int32_t processNymbox(const std::string &SERVER_ID, const std::string &USER_ID)
static EXPORT void FlushMessageBuffer()
static EXPORT int64_t ReplyNotice_GetRequestNum(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &THE_TRANSACTION)
Transactions do not have request numbers. However, if you have a.
static EXPORT bool Msg_HarvestTransactionNumbers(const std::string &THE_MESSAGE, const std::string &USER_ID, const bool &bHarvestingForRetry, const bool &bReplyWasSuccess, const bool &bReplyWasFailure, const bool &bTransactionWasSuccess, const bool &bTransactionWasFailure)
static EXPORT std::string GetNym_RecentHash(const std::string &SERVER_ID, const std::string &NYM_ID)
static EXPORT std::string GetNym_OutboxHash(const std::string &ACCOUNT_ID, const std::string &NYM_ID)
EXPORT OT_UTILITY_OT bool insureHaveAllBoxReceipts(const std::string &serverID, const std::string &nymID, const std::string &accountID, int32_t nBoxType)
EXPORT OT_UTILITY_OT std::string getLastReplyReceived() const
OT_UTILITY_OT bool VerifyMessage(const string &strMessage)
EXPORT OT_UTILITY_OT int32_t receiveReplySuccessLowLevel(const std::string &serverID18, const std::string &nymID, int32_t nRequestNumber7, const std::string &IN_FUNCTION)
OTLOG_IMPORT OTLogStream otOut
OTLOG_IMPORT OTLogStream otLog3
static EXPORT int32_t getAccountFiles(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCT_ID)
static EXPORT std::string Nymbox_GetReplyNotice(const std::string &SERVER_ID, const std::string &USER_ID, const int64_t &REQUEST_NUMBER)
EXPORT OT_UTILITY_OT void delay() const
OT_UTILITY_OT int32_t VerifyMsgBalanceAgrmntSuccess(const string &SERVER_ID, const string &USER_ID, const string &ACCOUNT_ID, const string &strMessage)
static EXPORT bool RemoveSentMessage(const int64_t &REQUEST_NUMBER, const std::string &SERVER_ID, const std::string &USER_ID)
OT_UTILITY_OT int32_t VerifyMessageSuccess(const string &strMessage)
EXPORT OT_UTILITY_OT bool getIntermediaryFiles_old(const std::string &serverID, const std::string &nymID, const std::string &accountID, bool bForceDownload)
static EXPORT int32_t getBoxReceipt(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const int32_t &nBoxType, const int64_t &TRANSACTION_NUMBER)
OT_UTILITY_OT int32_t InterpretTransactionMsgReply(const string &SERVER_ID, const string &USER_ID, const string &ACCOUNT_ID, const string &strAttempt, const string &strResponse)
static EXPORT std::string LoadNymboxNoVerify(const std::string &SERVER_ID, const std::string &USER_ID)
EXPORT OT_UTILITY_OT int32_t getNymboxLowLevel(const std::string &serverID, const std::string &nymID)
static EXPORT int32_t Ledger_GetCount(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_LEDGER)
Find out how many pending transactions (and receipts) are in this inbox.
OT_UTILITY_OT bool VerifyExists(const string &theObjectNameAsStr)
static EXPORT void Sleep(const int64_t &MILLISECONDS)
static EXPORT int32_t Message_GetTransactionSuccess(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_MESSAGE)
EXPORT OT_UTILITY_OT int32_t getInboxAccount_old(const std::string &serverID, const std::string &nymID, const std::string &accountID, bool &bWasSentInbox, bool &bWasSentAccount, bool bForceDownload)
static EXPORT bool VerifySignature(const std::string &SIGNER_NYM_ID, const std::string &THE_CONTRACT)
static EXPORT OTVariable * FindVariable2(const std::string &str_var_name)
EXPORT OT_UTILITY_OT int32_t getRequestNumber(const std::string &serverID, const std::string &nymID)
static EXPORT std::string Ledger_GetTransactionByID(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_LEDGER, const int64_t &TRANSACTION_NUMBER)
static EXPORT int64_t Ledger_GetTransactionIDByIndex(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_LEDGER, const int32_t &nIndex)
static EXPORT std::string GetNym_NymboxHash(const std::string &SERVER_ID, const std::string &NYM_ID)
EXPORT OT_UTILITY_OT bool getTransactionNumbers(const std::string &serverID, const std::string &nymID)
OTLOG_IMPORT OTLogStream otInfo
static EXPORT int32_t getAccount(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCT_ID)
EXPORT OT_UTILITY_OT void setNbrTransactionCount(int32_t new_trans_dl)
OT_UTILITY_OT bool VerifyStringVal(const std::string &nValue)
static EXPORT std::string GetAccountWallet_OutboxHash(const std::string &ACCOUNT_ID)
static EXPORT int32_t getNymbox(const std::string &SERVER_ID, const std::string &USER_ID)
static EXPORT int32_t getTransactionNumber(const std::string &SERVER_ID, const std::string &USER_ID)
EXPORT OT_UTILITY_OT std::string ReceiveReplyLowLevel(const std::string &serverID17, const std::string &nymID, int32_t nRequestNumber8, const std::string &IN_FUNCTION)
static EXPORT int32_t getRequest(const std::string &SERVER_ID, const std::string &USER_ID)
EXPORT OT_UTILITY_OT int32_t getAndProcessNymbox_8(const std::string &serverID, const std::string &nymID, bool &bWasMsgSent, bool bForceDownload, int32_t nRequestNumber, bool &bFoundNymboxItem, bool bHarvestingForRetry, const OTfourbool &bMsgFoursome)
EXPORT OT_UTILITY_OT int32_t processNymbox(const std::string &serverID, const std::string &nymID, bool &bWasMsgSent, int32_t &nMsgSentRequestNumOut, int32_t &nReplySuccessOut, int32_t &nBalanceSuccessOut, int32_t &nTransSuccessOut)
OTLOG_IMPORT OTLogStream otWarn
OT_UTILITY_OT int32_t VerifyMsgTrnxSuccess(const string &SERVER_ID, const string &USER_ID, const string &ACCOUNT_ID, const string &strMessage)
static EXPORT void FlushSentMessages(const bool &bHarvestingForRetry, const std::string &SERVER_ID, const std::string &USER_ID, const std::string &THE_NYMBOX)
EXPORT OT_UTILITY_OT int32_t sendProcessNymboxLowLevel(const std::string &serverID, const std::string &nymID) const
std::array< bool, 4 > OTfourbool
EXPORT OT_UTILITY_OT void setLastReplyReceived(const std::string &strReply)
EXPORT OT_UTILITY_OT int32_t getInboxAccount(const std::string &serverID, const std::string &nymID, const std::string &accountID, bool &bWasSentInbox, bool &bWasSentAccount)
static EXPORT std::string Message_GetNymboxHash(const std::string &THE_MESSAGE)
EXPORT OT_UTILITY_OT int32_t getInboxLowLevel(const std::string &serverID, const std::string &nymID, const std::string &accountID, bool &bWasSent)
static EXPORT int32_t getOutbox(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCT_ID)
static EXPORT std::string PopMessageBuffer(const int64_t &REQUEST_NUMBER, const std::string &SERVER_ID, const std::string &USER_ID)
EXPORT OT_UTILITY_OT bool getIntermediaryFiles(const std::string &serverID, const std::string &nymID, const std::string &accountID)
EXPORT OT_UTILITY_OT Utility()
static EXPORT std::string GetAccountWallet_InboxHash(const std::string &ACCOUNT_ID)
EXPORT OT_UTILITY_OT void longDelay() const
static EXPORT int32_t getInbox(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCT_ID)
EXPORT OT_UTILITY_OT int32_t getTransactionNumLowLevel(const std::string &serverID, const std::string &nymID, bool &bWasSent)
EXPORT OT_UTILITY_OT bool getInboxOutboxAccount(const std::string &accountID)
static EXPORT std::string LoadInboxNoVerify(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID)
These versions don't verify the ledger, they just load it up.
EXPORT OT_UTILITY_OT ~Utility()
static EXPORT bool HaveAlreadySeenReply(const std::string &SERVER_ID, const std::string &USER_ID, const int64_t &REQUEST_NUMBER)
static EXPORT std::string GetAccountWallet_ServerID(const std::string &ACCOUNT_ID)
static EXPORT std::string Transaction_GetType(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_TRANSACTION)
Get Transaction Type (internally uses GetTransactionTypeString().)
static EXPORT int32_t Message_GetBalanceAgreementSuccess(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_MESSAGE)