// Called by the above function. // This ledger is an outbox, and it is creating a report of itself, // adding each report item to this balance item. // DO NOT call this, it's meant to be used only by above function. void OTLedger::ProduceOutboxReport(OTItem & theBalanceItem) { if (OTLedger::outbox != GetType()) { OTLog::Error("OTLedger::ProduceOutboxReport: Wrong ledger type.\n"); return; } // loop through the OUTBOX transactions, and produce a sub-item onto theBalanceItem for each, which will // be a report on each pending transfer in this outbox, therefore added to the balance item. // (So the balance item contains a complete report on the outoing transfers in this outbox.) OTTransaction * pTransaction = NULL; for (mapOfTransactions::iterator ii = m_mapTransactions.begin(); ii != m_mapTransactions.end(); ++ii) { pTransaction = (*ii).second; OT_ASSERT(NULL != pTransaction); // it only reports receipts where we don't yet have balance agreement. pTransaction->ProduceOutboxReportItem(theBalanceItem); // <======= This function adds a pending transfer sub-item to theBalanceItem, where appropriate. } // --------------------------------------------------------- }