From c094772bc01dcd8f64864298d8f8cbe0e744bf2c Mon Sep 17 00:00:00 2001 From: Tom Ritchford Date: Wed, 1 Jul 2015 12:57:59 -0400 Subject: [PATCH] Restrict Ledger.cpp to 80 columns. --- src/ripple/app/ledger/Ledger.cpp | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/ripple/app/ledger/Ledger.cpp b/src/ripple/app/ledger/Ledger.cpp index bef15b21d..5e2b9336f 100644 --- a/src/ripple/app/ledger/Ledger.cpp +++ b/src/ripple/app/ledger/Ledger.cpp @@ -396,7 +396,8 @@ void Ledger::setAccepted ( void Ledger::setAccepted () { // used when we acquired the ledger - // FIXME assert(closed() && (info_.closeTime != 0) && (mCloseResolution != 0)); + // TODO: re-enable a test like the following: + // assert(closed() && (info_.closeTime != 0) && (mCloseResolution != 0)); if ((mCloseFlags & sLCF_NoConsensusTime) == 0) info_.closeTime = roundCloseTime( info_.closeTime, mCloseResolution); @@ -428,7 +429,9 @@ getTransaction (Ledger const& ledger, return txn; if (type == SHAMapTreeNode::tnTRANSACTION_NM) + { txn = Transaction::sharedTransaction (item->peekData (), Validate::YES); + } else if (type == SHAMapTreeNode::tnTRANSACTION_MD) { auto sit = SerialIter{item->data(), item->size()}; @@ -441,7 +444,10 @@ getTransaction (Ledger const& ledger, } if (txn->getStatus () == NEW) - txn->setStatus (ledger.isClosed() ? COMMITTED : INCLUDED, ledger.getLedgerSeq()); + { + txn->setStatus ( + ledger.isClosed() ? COMMITTED : INCLUDED, ledger.getLedgerSeq()); + } cache.canonicalize (&txn); return txn; @@ -621,8 +627,9 @@ bool Ledger::saveValidatedLedger (bool current) if (!accts.empty ()) { - std::string sql ("INSERT INTO AccountTransactions " - "(TransID, Account, LedgerSeq, TxnSeq) VALUES "); + std::string sql ( + "INSERT INTO AccountTransactions " + "(TransID, Account, LedgerSeq, TxnSeq) VALUES "); // Try to make an educated guess on how much space we'll need // for our arguments. In argument order we have: @@ -674,11 +681,12 @@ bool Ledger::saveValidatedLedger (bool current) auto db (getApp().getLedgerDB ().checkoutDb ()); // TODO(tom): ARG! - *db << boost::str (addLedger % - to_string (getHash ()) % info_.seq % to_string (mParentHash) % - beast::lexicalCastThrow (mTotCoins) % info_.closeTime % - info_.parentCloseTime % mCloseResolution % mCloseFlags % - to_string (mAccountHash) % to_string (mTransHash)); + *db << boost::str ( + addLedger % + to_string (getHash ()) % info_.seq % to_string (mParentHash) % + beast::lexicalCastThrow (mTotCoins) % info_.closeTime % + info_.parentCloseTime % mCloseResolution % mCloseFlags % + to_string (mAccountHash) % to_string (mTransHash)); } // Clients can now trust the database for