146 #include <irrxml/irrXML.hpp>
173 int32_t nType =
static_cast<int32_t
>(theType);
199 std::set<int64_t> setUnloaded;
207 const int32_t nLedgerType =
static_cast<int32_t
>(
GetType());
212 otErr <<
"OTLedger::VerifyAccount: Failure: Bad ledger type: "
213 << nLedgerType <<
", UserID: " << strNymID
214 <<
", AcctID: " << strAccountID <<
"\n";
255 for (
auto& it : m_mapTransactions) {
269 otErr <<
"OTLedger::SaveBoxReceipts: Failed calling SaveBoxReceipt "
285 if (
nullptr == pTransaction) {
286 otOut <<
"OTLedger::SaveBoxReceipt: Unable to save box receipt "
289 "couldn't find the transaction on this ledger.\n";
303 if (
nullptr == pTransaction) {
304 otOut <<
"OTLedger::DeleteBoxReceipt: Unable to delete (overwrite) box "
305 "receipt " << lTransactionNum
306 <<
": couldn't find the transaction on this ledger.\n";
326 std::set<int64_t> the_set;
328 for (
auto& it : m_mapTransactions) {
338 for (
auto& it : the_set) {
339 int64_t lSetNum = it;
352 pTransaction =
nullptr;
356 if (
nullptr != psetUnloaded) {
357 psetUnloaded->insert(lSetNum);
360 *pLog <<
"OTLedger::LoadBoxReceipts: Failed calling LoadBoxReceipt "
362 "abbreviated transaction number:" << lSetNum <<
".\n";
372 if (
nullptr == psetUnloaded)
break;
408 if (
nullptr == pTransaction) {
410 << __FUNCTION__ <<
": Unable to load box receipt "
412 <<
": couldn't find abbreviated version already on this ledger.\n";
440 if (
nullptr != pBoxReceipt) {
448 pTransaction =
nullptr;
545 const char* pszFolder =
nullptr;
568 otErr <<
"OTLedger::LoadGeneric: Error: unknown box type. (This should "
584 strFilename = strID.
Get();
586 const char* szFolder1name =
588 const char* szFolder2name = strServerID.
Get();
589 const char* szFilename = strFilename.
Get();
596 if (
nullptr != pString)
597 strRawFile.
Set(*pString);
600 if (!
OTDB::Exists(szFolder1name, szFolder2name, szFilename)) {
601 otLog3 << pszType <<
" does not exist in OTLedger::Load" << pszType
611 szFolder1name, szFolder2name,
614 if (strFileContents.length() < 2) {
615 otErr <<
"OTLedger::LoadGeneric: Error reading file: "
621 strRawFile.
Set(strFileContents.c_str());
626 if (!strRawFile.
Exists()) {
627 otErr <<
"OTLedger::LoadGeneric: Unable to load box (" << szFolder1name
630 <<
") from empty string.\n";
637 otErr <<
"Failed loading " << pszType <<
" "
638 << ((
nullptr != pString) ?
"from string" :
"from file")
639 <<
" in OTLedger::Load" << pszType <<
": " << szFolder1name
645 otInfo <<
"Successfully loaded " << pszType <<
" "
646 << ((
nullptr != pString) ?
"from string" :
"from file")
647 <<
" in OTLedger::Load" << pszType <<
": " << szFolder1name
659 const char* pszFolder =
nullptr;
683 otErr <<
"OTLedger::SaveGeneric: Error: unknown box type. (This should "
699 strFilename = strID.
Get();
701 const char* szFolder1name =
703 const char* szFolder2name = strServerID.
Get();
704 const char* szFilename = strFilename.
Get();
715 otErr <<
"OTLedger::SaveGeneric: Error saving " << pszType
726 otErr <<
"OTLedger::SaveGeneric: Error saving " << pszType
727 <<
" (failed writing armored string):\n" << szFolder1name
737 otErr <<
"OTLedger::SaveGeneric: Error writing " << pszType
743 otInfo <<
"Successfully saved " << pszType <<
": " << szFolder1name
763 otErr <<
"OTLedger::CalculateHash: Failed trying to calculate hash "
773 otErr <<
"Wrong ledger type passed to OTLedger::CalculateInboxHash.\n";
783 otErr <<
"Wrong ledger type passed to OTLedger::CalculateOutboxHash.\n";
793 otErr <<
"Wrong ledger type passed to OTLedger::CalculateNymboxHash.\n";
808 otErr <<
"Wrong ledger type passed to OTLedger::SaveNymbox.\n";
820 if (bSaved && (
nullptr != pNymboxHash)) {
824 otErr <<
"OTLedger::SaveNymbox: Failed trying to calculate nymbox "
856 otErr <<
"Wrong ledger type passed to OTLedger::SaveInbox.\n";
868 if (bSaved && (
nullptr != pInboxHash)) {
873 otErr <<
"OTLedger::SaveInbox: Failed trying to calculate Inbox "
888 otErr <<
"Wrong ledger type passed to OTLedger::SaveOutbox.\n";
900 if (bSaved && (
nullptr != pOutboxHash)) {
905 otErr <<
"OTLedger::SaveOutbox: Failed trying to calculate Outbox "
916 otErr <<
"Wrong ledger type passed to OTLedger::SavePaymentInbox.\n";
927 otErr <<
"Wrong ledger type passed to OTLedger::SaveRecordBox.\n";
938 otErr <<
"Wrong ledger type passed to OTLedger::SaveExpiredBox.\n";
955 pLedger->
GenerateLedger(theAcctID, theServerID, theType, bCreateFile);
967 OTString strID(theAcctID), strServerID(theServerID);
1002 otLog4 <<
"Generating message ledger...\n";
1013 OT_FAIL_MSG(
"OTLedger::GenerateLedger: GenerateLedger is only for "
1014 "message, nymbox, inbox, outbox, and paymentInbox "
1029 strFilename = strID.
Get();
1031 const char* szFolder1name =
1033 const char* szFolder2name = strServerID.
Get();
1034 const char* szFilename =
1039 if (
OTDB::Exists(szFolder1name, szFolder2name, szFilename)) {
1040 otOut <<
"ERROR: trying to generate ledger that already exists: "
1054 std::unique_ptr<OTAccount> pAccount(
1057 if (
nullptr != pAccount)
1060 otErr <<
"OTLedger::GenerateLedger: Failed in "
1061 "OTAccount::LoadExistingAccount().\n";
1069 std::unique_ptr<OTAccount> pAccount(
1072 if (
nullptr != pAccount)
1127 , m_bLoadedLegacyData(false)
1143 , m_bLoadedLegacyData(false)
1155 , m_bLoadedLegacyData(false)
1162 return m_mapTransactions;
1171 auto it = m_mapTransactions.find(lTransactionNum);
1174 if (it == m_mapTransactions.end()) {
1175 otErr <<
"OTLedger::RemoveTransaction"
1176 <<
": Attempt to remove Transaction from ledger, when "
1177 "not already there: " << lTransactionNum <<
"\n";
1184 m_mapTransactions.erase(it);
1187 delete pTransaction;
1188 pTransaction =
nullptr;
1201 if (it == m_mapTransactions.end()) {
1208 otErr <<
"Attempt to add Transaction to ledger when already there for "
1219 for (
auto& it : m_mapTransactions) {
1223 if (theType == pTransaction->
GetType())
return pTransaction;
1235 int32_t nIndex = -1;
1237 for (
auto& it : m_mapTransactions) {
1256 for (
auto& it : m_mapTransactions) {
1261 return pTransaction;
1276 for (
auto& it : m_mapTransactions) {
1293 int32_t nIndexCount = -1;
1295 for (
auto& it : m_mapTransactions) {
1301 if (nIndexCount == nIndex)
return pTransaction;
1315 for (
auto& it : m_mapTransactions) {
1322 if (pTransaction->
GetRequestNum() == lRequestNum)
return pTransaction;
1331 for (
auto& it : m_mapTransactions) {
1345 otErr <<
"OTLedger::" << __FUNCTION__
1346 <<
": Wrong item type attached to transferReceipt!\n";
1373 if (pOriginalItem->GetNumberOfOrigin() == lNumberOfOrigin)
1376 return pTransaction;
1407 for (
auto& it : m_mapTransactions) {
1422 if (
nullptr == pOriginalItem) {
1423 otErr << __FUNCTION__
1424 <<
": Expected original depositCheque request item to be "
1425 "inside the chequeReceipt "
1426 "(but failed to load it...)\n";
1430 pOriginalItem->GetTypeString(strItemType);
1431 otErr << __FUNCTION__
1432 <<
": Expected original depositCheque request item to be "
1433 "inside the chequeReceipt, "
1434 "but somehow what we found instead was a " << strItemType
1441 pOriginalItem->GetAttachment(strCheque);
1445 std::unique_ptr<OTCheque> theChequeAngel(pCheque);
1449 otErr << __FUNCTION__ <<
": Error loading cheque from string:\n"
1450 << strCheque <<
"\n";
1475 if (
nullptr != ppChequeOut)
1480 theChequeAngel.release();
1483 return pCurrentReceipt;
1509 for (
auto& it : m_mapTransactions) {
1517 return pTransaction;
1539 otErr <<
"OTLedger::GenerateBalanceStatement: Wrong ledger type.\n";
1548 otErr <<
"Wrong Account passed in to "
1549 "OTLedger::GenerateBalanceStatement.\n";
1555 otErr <<
"Wrong Outbox passed in to "
1556 "OTLedger::GenerateBalanceStatement.\n";
1560 otErr <<
"Wrong Nym passed in to OTLedger::GenerateBalanceStatement.\n";
1573 if (
nullptr == pBalanceItem)
return nullptr;
1629 otErr <<
"OTLedger::" << __FUNCTION__
1630 <<
": wrong owner transaction type: " << theOwner.
GetTypeString()
1635 OTString strMessageNym(theMessageNym);
1643 int64_t lCurrentBalance = theAccount.
GetBalance();
1645 pBalanceItem->
SetAmount(lCurrentBalance + lAdjustment);
1659 otInfo <<
"About to loop through the inbox items and produce a report for "
1662 for (
auto& it : m_mapTransactions) {
1666 otInfo <<
"Producing a report...\n";
1687 return pBalanceItem;
1697 int64_t lTotalPendingValue = 0;
1700 otErr <<
"OTLedger::GetTotalPendingValue: Wrong ledger type (expected "
1705 for (
auto& it : m_mapTransactions) {
1710 lTotalPendingValue +=
1716 return lTotalPendingValue;
1726 otErr << __FUNCTION__ <<
": Wrong ledger type.\n";
1736 for (
auto& it : m_mapTransactions) {
1754 bool bLoaded =
false;
1759 if (theStr.
Contains(
"\"\n type=\"nymbox\""))
1761 else if (theStr.
Contains(
"\"\n type=\"inbox\""))
1763 else if (theStr.
Contains(
"\"\n type=\"outbox\""))
1765 else if (theStr.
Contains(
"\"\n type=\"paymentInbox\""))
1767 else if (theStr.
Contains(
"\"\n type=\"recordBox\""))
1769 else if (theStr.
Contains(
"\"\n type=\"expiredBox\""))
1771 else if (theStr.
Contains(
"\"\n type=\"message\"")) {
1782 bool bSavingAbbreviated =
1784 int32_t nPartialRecordCount = 0;
1791 bSavingAbbreviated =
false;
1792 nPartialRecordCount = 0;
1808 bSavingAbbreviated =
true;
1809 nPartialRecordCount =
static_cast<int32_t
>(
1810 m_mapTransactions.size());
1816 otErr <<
"OTLedger::UpdateContents: Error: unexpected box type (1st "
1817 "block). (This should never happen.)\n";
1839 int32_t nPartialACTUALCount = 0;
1842 for (
auto& it : m_mapTransactions) {
1855 ascTransaction.
SetString(strTransaction,
true);
1856 strLedgerContents.
Concatenate(
"<transaction>\n%s</transaction>\n\n",
1857 ascTransaction.
Get());
1884 otErr <<
"OTLedger::UpdateContents: Error: unexpected box type "
1885 "(2nd block). (This should never happen. Skipping.)\n";
1887 OT_FAIL_MSG(
"ASSERT: OTLedger::UpdateContents: Unexpected "
1893 nPartialACTUALCount++;
1901 "ASSERT: OTLedger::UpdateContents: "
1902 "OT_ASSERT_MSG(nPartialACTUALCount == nPartialRecordCount)");
1908 "numPartialRecords=\"%d\"\n "
1909 "accountID=\"%s\"\n "
1911 "serverID=\"%s\" >\n\n",
1913 nPartialRecordCount, strLedgerAcctID.Get(),
1914 strUserID.
Get(), strLedgerAcctServerID.Get());
1924 const char* szFunc =
"OTLedger::ProcessXMLNode";
1926 const OTString strNodeName = xml->getNodeName();
1928 if (strNodeName.
Compare(
"accountLedger")) {
1931 strLedgerAcctServerID,
1932 strUserID, strNumPartialRecords;
1937 strType = xml->getAttributeValue(
"type");
1940 if (strType.
Compare(
"message"))
1944 else if (strType.
Compare(
"nymbox"))
1948 else if (strType.
Compare(
"inbox"))
1953 else if (strType.
Compare(
"outbox"))
1955 else if (strType.
Compare(
"paymentInbox"))
1957 else if (strType.
Compare(
"recordBox"))
1962 else if (strType.
Compare(
"expiredBox"))
1970 strLedgerAcctID = xml->getAttributeValue(
"accountID");
1971 strLedgerAcctServerID = xml->getAttributeValue(
"serverID");
1972 strUserID = xml->getAttributeValue(
"userID");
1974 if (!strLedgerAcctID.
Exists() || !strLedgerAcctServerID.
Exists() ||
1976 otOut << szFunc <<
": Failure: missing strLedgerAcctID ("
1977 << strLedgerAcctID <<
") or "
1978 "strLedgerAcctServerID ("
1979 << strLedgerAcctServerID <<
") or strUserID (" << strUserID
1980 <<
") while loading transaction "
1981 "from " << strType <<
" ledger. \n";
1986 SERVER_ID(strLedgerAcctServerID), USER_ID(strUserID);
2004 strNumPartialRecords = xml->getAttributeValue(
"numPartialRecords");
2005 int32_t nPartialRecordCount =
2006 (strNumPartialRecords.
Exists() ? atoi(strNumPartialRecords.
Get())
2015 strExpected.
Set(
"nymboxRecord");
2016 pNumList = &theNumList;
2019 strExpected.
Set(
"inboxRecord");
2022 strExpected.
Set(
"outboxRecord");
2025 strExpected.
Set(
"paymentInboxRecord");
2028 strExpected.
Set(
"recordBoxRecord");
2031 strExpected.
Set(
"expiredBoxRecord");
2035 if (nPartialRecordCount > 0) {
2036 otErr << szFunc <<
": Error: There are " << nPartialRecordCount
2037 <<
" unexpected abbreviated records in an "
2038 "OTLedger::message type ledger. (Failed loading "
2039 "ledger with accountID: " << strLedgerAcctID <<
")\n";
2045 otErr <<
"OTLedger::ProcessXMLNode: Unexpected ledger type ("
2046 << strType <<
"). (Failed loading "
2047 "ledger for account: " << strLedgerAcctID
2052 if (nPartialRecordCount > 0)
2060 while (nPartialRecordCount-- > 0) {
2063 otOut << szFunc <<
": Failure: Unable to find element when "
2064 "one was expected (" << strExpected
2066 "for abbreviated record of receipt in "
2081 const OTString strLoopNodeName = xml->getNodeName();
2083 if (strLoopNodeName.
Exists() &&
2084 (xml->getNodeType() == irr::io::EXN_ELEMENT) &&
2085 (strExpected.
Compare(strLoopNodeName))) {
2086 int64_t lNumberOfOrigin = 0;
2087 int64_t lTransactionNum = 0;
2088 int64_t lInRefTo = 0;
2089 int64_t lInRefDisplay = 0;
2095 int64_t lAdjustment = 0;
2096 int64_t lDisplayValue = 0;
2097 int64_t lClosingNum = 0;
2098 int64_t lRequestNum = 0;
2099 bool bReplyTransSuccess =
false;
2102 xml, lNumberOfOrigin, lTransactionNum, lInRefTo,
2103 lInRefDisplay, the_DATE_SIGNED, theType, strHash,
2104 lAdjustment, lDisplayValue, lClosingNum, lRequestNum,
2109 if ((-1) == nAbbrevRetVal)
2119 if (
nullptr != pExistingTrans)
2121 otOut << szFunc <<
": Error loading transaction "
2122 << lTransactionNum <<
" (" << strExpected
2123 <<
"), since one was already there, in box for "
2124 "account: " << strLedgerAcctID <<
".\n";
2137 USER_ID, ACCOUNT_ID, SERVER_ID, lNumberOfOrigin,
2138 lTransactionNum, lInRefTo,
2139 lInRefDisplay, the_DATE_SIGNED,
2140 static_cast<OTTransaction::transactionType>(theType),
2141 strHash, lAdjustment, lDisplayValue, lClosingNum,
2142 lRequestNum, bReplyTransSuccess,
2201 otErr << szFunc <<
": ERROR: verifying contract ID on "
2202 "abbreviated transaction "
2204 delete pTransaction;
2205 pTransaction =
nullptr;
2215 <<
": Expected abbreviated record element.\n";
2221 otLog4 << szFunc <<
": Loading account ledger of type \"" << strType
2265 else if (strNodeName.
Compare(
"transaction")) {
2272 otOut << __FUNCTION__
2273 <<
": Failure: Unable to find expected text field "
2274 "containing receipt transaction in box. \n";
2278 if (irr::io::EXN_TEXT == xml->getNodeType()) {
2281 const OTString strLoopNodeData = xml->getNodeData();
2283 if (strLoopNodeData.
Exists())
2284 ascTransaction.
Set(strLoopNodeData);
2290 if (!ascTransaction.
Exists() ||
2291 !ascTransaction.
GetString(strTransaction)) {
2292 otErr << __FUNCTION__
2293 <<
": ERROR: Missing expected transaction contents. "
2335 if (strTransaction.
Exists() &&
2345 if (
nullptr != pExistingTrans)
2349 << szFunc <<
": Error loading full transaction "
2351 <<
", since one was already there, in box for account: "
2352 << strPurportedAcctID <<
".\n";
2353 delete pTransaction;
2354 pTransaction =
nullptr;
2381 otOut <<
"--- Apparently this is old data (the transaction "
2382 "is still stored inside the ledger itself)... \n";
2385 const int32_t nBoxType =
static_cast<int32_t
>(
GetType());
2387 const bool bBoxReceiptAlreadyExists =
2398 if (!bBoxReceiptAlreadyExists)
2403 otOut <<
"--- The BoxReceipt doesn't exist separately "
2404 "(yet.) Creating it in local storage...\n";
2406 const int64_t lBoxType =
static_cast<int64_t
>(nBoxType);
2411 otErr <<
"--- FAILED trying to save BoxReceipt "
2412 "from legacy data to local storage!\n";
2417 <<
": Unknown ledger type while loading transaction!"
2418 " (Should never happen.)\n";
2426 otErr <<
"ERROR: loading or verifying transaction in "
2427 "OTLedger::ProcessXMLNode\n";
2428 if (
nullptr != pTransaction) {
2429 delete pTransaction;
2430 pTransaction =
nullptr;
2436 otErr <<
"Error in OTLedger::ProcessXMLNode: transaction without "
2455 while (!m_mapTransactions.empty()) {
2456 OTTransaction* pTransaction = m_mapTransactions.begin()->second;
2457 m_mapTransactions.erase(m_mapTransactions.begin());
2458 delete pTransaction;
2459 pTransaction =
nullptr;
EXPORT bool LoadInboxFromString(const OTString &strBox)
EXPORT bool StorePlainString(std::string strContents, std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
EXPORT void GetReferenceString(OTString &theStr) const
EXPORT bool RemoveTransaction(int64_t lTransactionNum, bool bDeleteIt=true)
OTLOG_IMPORT OTLogStream otLog4
static EXPORT char const * _GetTypeString(ledgerType theType)
void SetAmount(int64_t lAmount)
EXPORT OTItem * GenerateBalanceStatement(int64_t lAdjustment, const OTTransaction &theOwner, OTPseudonym &theNym, const OTAccount &theAccount, OTLedger &theOutbox)
int32_t GetTransactionCount() const
int32_t LoadAbbreviatedRecord(irr::io::IrrXMLReader *&xml, int64_t &lNumberOfOrigin, int64_t &lTransactionNum, int64_t &lInRefTo, int64_t &lInRefDisplay, time64_t &the_DATE_SIGNED, int &theType, OTString &strHash, int64_t &lAdjustment, int64_t &lDisplayValue, int64_t &lClosingNum, int64_t &lRequestNum, bool &bReplyTransSuccess, OTNumList *pNumList=nullptr)
virtual EXPORT bool SaveContractWallet(std::ofstream &ofs) const
void SaveAbbrevExpiredBoxRecord(OTString &strOutput)
static EXPORT OTItem * CreateItemFromString(const OTString &strItem, const OTIdentifier &theServerID, int64_t lTransactionNumber)
EXPORT bool CalculateNymboxHash(OTIdentifier &theOutput)
EXPORT bool LoadBoxReceipt(const int64_t &lTransactionNum)
EXPORT bool VerifyBoxReceiptExists(const OTIdentifier &SERVER_ID, const OTIdentifier &USER_ID, const OTIdentifier &ACCOUNT_ID, int32_t nBoxType, const int64_t &lTransactionNum)
EXPORT bool CalculateDigest(const OTData &dataInput)
EXPORT OTTransaction * GetTransferReceipt(int64_t lNumberOfOrigin)
void SaveAbbrevRecordBoxRecord(OTString &strOutput)
EXPORT bool SaveOutbox(OTIdentifier *pOutboxHash=nullptr)
void SaveAbbreviatedInboxRecord(OTString &strOutput)
EXPORT bool LoadRecordBox()
EXPORT bool SaveBoxReceipts()
virtual EXPORT bool VerifyAccount(const OTPseudonym &theNym)
int64_t GetTransactionNum() const
static EXPORT const OTString & PaymentInbox()
EXPORT bool DeleteBoxReceipt(const int64_t &lTransactionNum)
EXPORT int64_t GetBalance() const
EXPORT char const * GetTypeString() const
EXPORT bool DeleteBoxReceipt(OTLedger &theLedger)
EXPORT bool SaveContract()
static EXPORT const OTString & ExpiredBox()
bool LoadGeneric(ledgerType theType, const OTString *pString=nullptr)
static EXPORT const char * PathSeparator()
EXPORT void Release_Ledger()
void SaveAbbreviatedNymboxRecord(OTString &strOutput)
bool SaveGeneric(ledgerType theType)
EXPORT bool SaveRecordBox()
EXPORT bool SaveBoxReceipt(const int64_t &lTransactionNum)
void SaveAbbrevPaymentInboxRecord(OTString &strOutput)
EXPORT bool AddTransaction(OTTransaction &theTransaction)
OTLOG_IMPORT OTLogStream otOut
void SetRealAccountID(const OTIdentifier &theID)
OTLOG_IMPORT OTLogStream otLog3
EXPORT void SetAttachment(const OTString &theStr)
EXPORT bool SaveContractRaw(OTString &strOutput) const
EXPORT uint32_t GetLength() const
EXPORT void ProduceOutboxReport(OTItem &theBalanceItem)
virtual void UpdateContents()
EXPORT void Concatenate(const char *arg,...)
static EXPORT const OTString & Inbox()
EXPORT bool CalculateOutboxHash(OTIdentifier &theOutput)
void SetRealServerID(const OTIdentifier &theID)
EXPORT int32_t GetTransactionCountInRefTo(int64_t lReferenceNum) const
const int64_t & GetRequestNum() const
EXPORT bool WriteArmoredString(OTString &strOutput, const std::string str_type, bool bEscaped=false) const
static EXPORT const OTString & Nymbox()
EXPORT void HarvestIssuedNumbers(const OTIdentifier &theServerID, OTPseudonym &SIGNER_NYM, OTPseudonym &theOtherNym, bool bSave=false)
static EXPORT OTItem * CreateItemFromTransaction(const OTTransaction &theOwner, OTItem::itemType theType, const OTIdentifier *pDestinationAcctID=nullptr)
EXPORT bool SavePaymentInbox()
EXPORT bool Exists() const
EXPORT bool SetString(const OTString &theData, bool bLineBreaks=true)
virtual EXPORT void Release()
const char * GetTypeString() const
EXPORT void Format(const char *fmt,...)
EXPORT OTTransaction * GetReplyNotice(const int64_t &lRequestNum)
EXPORT void ReleaseTransactions()
EXPORT bool LoadRecordBoxFromString(const OTString &strBox)
const OTIdentifier & GetRealAccountID() const
EXPORT int32_t GetTransactionIndex(int64_t lTransactionNum)
EXPORT bool Compare(const char *compare) const
virtual int32_t ProcessXMLNode(irr::io::IrrXMLReader *&xml)
EXPORT bool LoadOutboxFromString(const OTString &strBox)
EXPORT bool RemoveTransactionNum(OTPseudonym &SIGNER_NYM, const OTString &strServerID, const int64_t &lTransNum)
const OTIdentifier & GetPurportedServerID() const
EXPORT void Set(const char *data, uint32_t enforcedMaxLength=0)
EXPORT bool LoadLedgerFromString(const OTString &theStr)
EXPORT std::string QueryPlainString(std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
OTTransaction * LoadBoxReceipt(OTTransaction &theAbbrev, OTLedger &theLedger)
char const *const __TypeStrings[]
EXPORT bool SaveExpiredBox()
EXPORT bool RemoveIssuedNum(OTPseudonym &SIGNER_NYM, const OTString &strServerID, const int64_t &lTransNum, bool bSave)
EXPORT bool CalculateHash(OTIdentifier &theOutput)
EXPORT bool LoadNymboxFromString(const OTString &strBox)
OTString m_strContractType
#define OT_ASSERT_MSG(x, s)
static EXPORT const OTString & Outbox()
static EXPORT OTLedger * GenerateLedger(const OTIdentifier &theUserID, const OTIdentifier &theAcctID, const OTIdentifier &theServerID, ledgerType theType, bool bCreateFile=false)
OTLOG_IMPORT OTLogStream otInfo
ledgerType GetType() const
EXPORT OTTransaction * GetTransactionByIndex(int32_t nIndex) const
static bool SkipToTextField(irr::io::IrrXMLReader *&xml)
EXPORT bool LoadBoxReceipts(std::set< int64_t > *psetUnloaded=nullptr)
virtual EXPORT void GetIdentifier(OTIdentifier &theIdentifier) const
EXPORT bool SaveNymbox(OTIdentifier *pNymboxHash=nullptr)
OTStringXML m_xmlUnsigned
EXPORT int64_t GetReferenceToNum() const
EXPORT bool SaveBoxReceipt(int64_t lLedgerType)
EXPORT int64_t GetTotalPendingValue()
EXPORT const char * Get() const
void SetUserID(const OTIdentifier &theID)
void SaveAbbreviatedOutboxRecord(OTString &strOutput)
virtual EXPORT bool SignContract(const OTPseudonym &theNym, const OTPasswordData *pPWData=nullptr)
transactionType GetType() const
static bool SkipToElement(irr::io::IrrXMLReader *&xml)
virtual EXPORT ~OTLedger()
void ProduceInboxReportItem(OTItem &theBalanceItem)
OTLOG_IMPORT OTLogStream otErr
const OTIdentifier & GetPurportedAccountID() const
EXPORT int64_t GetReceiptAmount()
virtual bool VerifyAccount(const OTPseudonym &theNym)
EXPORT bool LoadExpiredBox()
EXPORT int64_t GetTransactionNum() const
bool IsAbbreviated() const
void SetPurportedServerID(const OTIdentifier &theID)
virtual EXPORT bool VerifyContractID() const
EXPORT bool Exists(std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
EXPORT bool Contains(const char *compare) const
static EXPORT const OTString & RecordBox()
EXPORT bool LoadPaymentInboxFromString(const OTString &strBox)
const OTIdentifier & GetUserID() const
EXPORT bool GetString(OTString &theData, bool bLineBreaks=true) const
EXPORT bool LoadContractFromString(const OTString &theStr)
void ProduceOutboxReportItem(OTItem &theBalanceItem)
virtual EXPORT void Release()
EXPORT OTTransaction * GetFinalReceipt(int64_t lReferenceNum)
EXPORT bool LoadExpiredBoxFromString(const OTString &strBox)
EXPORT bool CalculateInboxHash(OTIdentifier &theOutput)
static EXPORT OTAccount * LoadExistingAccount(const OTIdentifier &accountId, const OTIdentifier &serverId)
void SetPurportedAccountID(const OTIdentifier &theID)
virtual EXPORT void Release()
const OTIdentifier & GetRealServerID() const
std::map< int64_t, OTTransaction * > mapOfTransactions
void SetParent(const OTLedger &theParent)
EXPORT OTTransaction * GetTransaction(OTTransaction::transactionType theType)
EXPORT const mapOfTransactions & GetTransactionMap() const
EXPORT bool SaveInbox(OTIdentifier *pInboxHash=nullptr)
EXPORT OTTransaction * GetChequeReceipt(int64_t lChequeNum, OTCheque **ppChequeOut=nullptr)
EXPORT bool LoadPaymentInbox()