Finish Log changes for module ripple_ledger

This commit is contained in:
Vinnie Falco
2013-05-22 12:46:03 -07:00
parent a5ab694e48
commit d8d52d975c
19 changed files with 275 additions and 258 deletions

View File

@@ -6,7 +6,10 @@
#include "Log.h"
DECLARE_INSTANCE(SerializedLedgerEntry)
SETUP_LOG();
struct SerializedLedger
{
};
SerializedLedgerEntry::SerializedLedgerEntry(SerializerIterator& sit, const uint256& index)
: STObject(sfLedgerEntry), mIndex(index), mMutable(true)
@@ -34,8 +37,8 @@ SerializedLedgerEntry::SerializedLedgerEntry(const Serializer& s, const uint256&
mType = mFormat->t_type;
if (!setType(mFormat->elements))
{
cLog(lsWARNING) << "Ledger entry not valid for type " << mFormat->t_name;
cLog(lsWARNING) << getJson(0);
WriteLog (lsWARNING, SerializedLedger) << "Ledger entry not valid for type " << mFormat->t_name;
WriteLog (lsWARNING, SerializedLedger) << getJson(0);
throw std::runtime_error("ledger entry not valid for type");
}
}
@@ -107,7 +110,7 @@ uint32 SerializedLedgerEntry::getThreadedLedger()
bool SerializedLedgerEntry::thread(const uint256& txID, uint32 ledgerSeq, uint256& prevTxID, uint32& prevLedgerID)
{
uint256 oldPrevTxID = getFieldH256(sfPreviousTxnID);
cLog(lsTRACE) << "Thread Tx:" << txID << " prev:" << oldPrevTxID;
WriteLog (lsTRACE, SerializedLedger) << "Thread Tx:" << txID << " prev:" << oldPrevTxID;
if (oldPrevTxID == txID)
{ // this transaction is already threaded
assert(getFieldU32(sfPreviousTxnLgrSeq) == ledgerSeq);