From 5425a90f160711e46b2c1f1c93d68e5941e4bfb6 Mon Sep 17 00:00:00 2001 From: Tom Ritchford Date: Tue, 14 Oct 2014 16:58:47 -0400 Subject: [PATCH] Fix tabs and trailing whitespace. --- src/ripple/app/consensus/LedgerConsensus.cpp | 4 +- src/ripple/app/ledger/AcceptedLedgerTx.cpp | 4 +- src/ripple/app/ledger/InboundLedgers.h | 2 +- src/ripple/app/ledger/Ledger.cpp | 2 +- src/ripple/app/ledger/Ledger.h | 2 +- src/ripple/app/ledger/LedgerCleaner.cpp | 2 +- src/ripple/app/ledger/LedgerTiming.cpp | 2 +- src/ripple/app/main/Application.cpp | 2 +- src/ripple/app/main/LoadManager.cpp | 2 +- src/ripple/app/paths/Pathfinder.cpp | 2 +- .../cursor/ForwardLiquidityForAccount.cpp | 2 +- src/ripple/app/peers/PeerSet.h | 8 +-- src/ripple/app/shamap/SHAMapDelta.cpp | 28 ++++---- src/ripple/app/transactors/AddWallet.cpp | 2 +- src/ripple/app/transactors/CancelTicket.cpp | 2 +- src/ripple/app/transactors/Change.cpp | 4 +- src/ripple/app/transactors/CreateOffer.cpp | 2 +- src/ripple/app/transactors/Payment.cpp | 2 +- src/ripple/app/transactors/SetTrust.cpp | 2 +- src/ripple/app/transactors/Transactor.cpp | 2 +- src/ripple/app/websocket/WSDoor.cpp | 4 +- src/ripple/basics/Log.h | 4 +- src/ripple/basics/LoggedTimings.h | 2 +- src/ripple/basics/impl/Log.cpp | 2 +- src/ripple/basics/impl/RangeSet.cpp | 2 +- src/ripple/basics/impl/Sustain.cpp | 2 +- src/ripple/common/MultiSocket.h | 2 +- src/ripple/common/TaggedCache.h | 4 +- src/ripple/common/impl/KeyCache.cpp | 2 +- src/ripple/common/impl/MultiSocketImpl.h | 4 +- src/ripple/common/impl/ResolverAsio.cpp | 2 +- src/ripple/common/impl/RippleSSLContext.cpp | 2 +- src/ripple/common/impl/TaggedCache.cpp | 2 +- src/ripple/common/tests/MultiSocket.test.cpp | 2 +- src/ripple/common/tests/cross_offer.test.cpp | 16 ++--- src/ripple/core/JobTypeData.h | 2 +- src/ripple/core/JobTypeInfo.h | 4 +- src/ripple/core/impl/Config.cpp | 4 +- src/ripple/core/impl/LoadMonitor.cpp | 2 +- src/ripple/data/crypto/Base58Data.cpp | 2 +- src/ripple/data/protocol/SField.h | 2 +- src/ripple/data/protocol/STAmount.h | 6 +- src/ripple/data/protocol/STAmount.test.cpp | 4 +- src/ripple/data/protocol/SerializedType.h | 2 +- src/ripple/data/protocol/TxFormats.cpp | 10 +-- src/ripple/http/Session.h | 2 +- src/ripple/http/impl/Peer.h | 2 +- src/ripple/http/impl/ServerImpl.h | 4 +- src/ripple/json/impl/Tests.cpp | 2 +- src/ripple/json/impl/json_reader.cpp | 6 +- src/ripple/nodestore/Backend.h | 2 +- src/ripple/nodestore/Database.h | 6 +- src/ripple/nodestore/Manager.h | 2 +- src/ripple/nodestore/NodeObject.h | 8 +-- src/ripple/nodestore/Scheduler.h | 2 +- .../nodestore/backend/LevelDBFactory.cpp | 2 +- src/ripple/nodestore/backend/NullFactory.cpp | 6 +- .../nodestore/backend/RocksDBFactory.cpp | 6 +- src/ripple/nodestore/impl/Manager.cpp | 2 +- src/ripple/nodestore/tests/DatabaseTests.cpp | 2 +- src/ripple/overlay/Message.h | 2 +- src/ripple/overlay/impl/OverlayImpl.h | 8 +-- src/ripple/overlay/impl/PeerImp.cpp | 14 ++-- src/ripple/overlay/impl/PeerImp.h | 6 +- src/ripple/peerfinder/Manager.h | 2 +- src/ripple/peerfinder/impl/Checker.h | 2 +- src/ripple/peerfinder/impl/Counts.h | 2 +- src/ripple/peerfinder/impl/Handouts.h | 2 +- src/ripple/peerfinder/impl/Livecache.h | 2 +- src/ripple/peerfinder/impl/SlotImp.h | 2 +- src/ripple/peerfinder/sim/GraphAlgorithms.h | 4 +- src/ripple/peerfinder/sim/Tests.cpp | 10 +-- src/ripple/peerfinder/sim/WrappedSink.h | 2 +- src/ripple/resource/impl/LegacyFees.cpp | 2 +- src/ripple/rpc/handlers/AccountLines.cpp | 8 +-- src/ripple/rpc/handlers/AccountOffers.cpp | 14 ++-- src/ripple/rpc/handlers/GetCounts.cpp | 2 +- src/ripple/rpc/impl/Tuning.h | 2 +- src/ripple/sslutil/impl/ECDSACanonical.cpp | 70 +++++++++---------- src/ripple/types/CryptoIdentifier.h | 4 +- src/ripple/types/IdentifierStorage.h | 2 +- src/ripple/types/impl/strHex.cpp | 4 +- src/ripple/types/strHex.h | 2 +- src/ripple/validators/impl/SourceFile.cpp | 4 +- src/ripple/validators/impl/Store.h | 2 +- src/ripple/validators/impl/StoreSqdb.cpp | 4 +- 86 files changed, 200 insertions(+), 200 deletions(-) diff --git a/src/ripple/app/consensus/LedgerConsensus.cpp b/src/ripple/app/consensus/LedgerConsensus.cpp index 132ea2f4d..746e03548 100644 --- a/src/ripple/app/consensus/LedgerConsensus.cpp +++ b/src/ripple/app/consensus/LedgerConsensus.cpp @@ -1372,7 +1372,7 @@ private: } } - /** + /** Revoke our outstanding proposal, if any, and cease proposing at least until this round ends */ @@ -1384,7 +1384,7 @@ private: { mOurPosition->bowOut(); propose(); - } + } mProposing = false; } } diff --git a/src/ripple/app/ledger/AcceptedLedgerTx.cpp b/src/ripple/app/ledger/AcceptedLedgerTx.cpp index 8e8decb2b..9db297c60 100644 --- a/src/ripple/app/ledger/AcceptedLedgerTx.cpp +++ b/src/ripple/app/ledger/AcceptedLedgerTx.cpp @@ -84,7 +84,7 @@ void AcceptedLedgerTx::buildJson () { affected.append (ra.humanAccountID ()); } - } + } if (mTxn->getTxnType () == ttOFFER_CREATE) { @@ -95,7 +95,7 @@ void AcceptedLedgerTx::buildJson () if (account != amount.issue ().account) { LedgerEntrySet les (mLedger, tapNONE, true); - auto const ownerFunds (les.accountFunds (account, amount, fhIGNORE_FREEZE)); + auto const ownerFunds (les.accountFunds (account, amount, fhIGNORE_FREEZE)); mJson[jss::transaction][jss::owner_funds] = ownerFunds.getText (); } diff --git a/src/ripple/app/ledger/InboundLedgers.h b/src/ripple/app/ledger/InboundLedgers.h index 09b6cd1f7..f933c32f6 100644 --- a/src/ripple/app/ledger/InboundLedgers.h +++ b/src/ripple/app/ledger/InboundLedgers.h @@ -38,7 +38,7 @@ public: // VFALCO TODO Should this be called findOrAdd ? // - virtual InboundLedger::pointer findCreate (uint256 const& hash, + virtual InboundLedger::pointer findCreate (uint256 const& hash, std::uint32_t seq, InboundLedger::fcReason) = 0; virtual InboundLedger::pointer find (LedgerHash const& hash) = 0; diff --git a/src/ripple/app/ledger/Ledger.cpp b/src/ripple/app/ledger/Ledger.cpp index 9d682f589..e16840f45 100644 --- a/src/ripple/app/ledger/Ledger.cpp +++ b/src/ripple/app/ledger/Ledger.cpp @@ -1401,7 +1401,7 @@ bool Ledger::visitAccountItems ( } } } - + bool found (false); for (;;) { diff --git a/src/ripple/app/ledger/Ledger.h b/src/ripple/app/ledger/Ledger.h index 25151af73..edde93fc7 100644 --- a/src/ripple/app/ledger/Ledger.h +++ b/src/ripple/app/ledger/Ledger.h @@ -278,7 +278,7 @@ public: SLE::pointer getAccountRoot (Account const& accountID) const; SLE::pointer getAccountRoot (const RippleAddress & naAccountID) const; void updateSkipList (); - + void visitAccountItems ( Account const& accountID, std::function) const; bool visitAccountItems ( diff --git a/src/ripple/app/ledger/LedgerCleaner.cpp b/src/ripple/app/ledger/LedgerCleaner.cpp index 56d43b15a..31b98380d 100644 --- a/src/ripple/app/ledger/LedgerCleaner.cpp +++ b/src/ripple/app/ledger/LedgerCleaner.cpp @@ -334,7 +334,7 @@ public: // See if the hash for the ledger we need is in the reference ledger ledgerHash = getLedgerHash(referenceLedger, ledgerIndex); if (ledgerHash.isZero()) - { + { // No, Try to get another ledger that might have the hash we need // Compute the index and hash of a ledger that will have the hash we need LedgerIndex refIndex = (ledgerIndex + 255) & (~255); diff --git a/src/ripple/app/ledger/LedgerTiming.cpp b/src/ripple/app/ledger/LedgerTiming.cpp index 6380ef72f..c7da845f7 100644 --- a/src/ripple/app/ledger/LedgerTiming.cpp +++ b/src/ripple/app/ledger/LedgerTiming.cpp @@ -51,7 +51,7 @@ bool ContinuousLedgerTiming::shouldClose ( // no transactions so far this interval if (proposersClosed > (previousProposers / 4)) // did we miss a transaction? { - WriteLog (lsTRACE, LedgerTiming) << + WriteLog (lsTRACE, LedgerTiming) << "no transactions, many proposers: now (" << proposersClosed << " closed, " << previousProposers << " before)"; return true; diff --git a/src/ripple/app/main/Application.cpp b/src/ripple/app/main/Application.cpp index 13780efef..cb6ccde19 100644 --- a/src/ripple/app/main/Application.cpp +++ b/src/ripple/app/main/Application.cpp @@ -293,7 +293,7 @@ public: m_logs.journal("PathRequest"), m_collectorManager->collector ())) , m_ledgerMaster (make_LedgerMaster (getConfig ().RUN_STANDALONE, - getConfig ().FETCH_DEPTH, getConfig ().LEDGER_HISTORY, + getConfig ().FETCH_DEPTH, getConfig ().LEDGER_HISTORY, getConfig ().getSize (siLedgerFetch), *m_jobQueue, m_collectorManager->collector (), m_logs.journal("LedgerMaster"))) diff --git a/src/ripple/app/main/LoadManager.cpp b/src/ripple/app/main/LoadManager.cpp index 618931bed..305ad2db2 100644 --- a/src/ripple/app/main/LoadManager.cpp +++ b/src/ripple/app/main/LoadManager.cpp @@ -41,7 +41,7 @@ public: , m_resourceFlags (0) { } - + Cost (LoadType loadType, int cost, int resourceFlags) : m_loadType (loadType) , m_cost (cost) diff --git a/src/ripple/app/paths/Pathfinder.cpp b/src/ripple/app/paths/Pathfinder.cpp index 3717bdfd5..8a72403e4 100644 --- a/src/ripple/app/paths/Pathfinder.cpp +++ b/src/ripple/app/paths/Pathfinder.cpp @@ -527,7 +527,7 @@ int Pathfinder::getPathsOut ( return it.first->second; auto sleAccount = mLedger->getSLEi (Ledger::getAccountRootIndex (accountID)); - + if (!sleAccount) return 0; diff --git a/src/ripple/app/paths/cursor/ForwardLiquidityForAccount.cpp b/src/ripple/app/paths/cursor/ForwardLiquidityForAccount.cpp index e40534816..4901bed24 100644 --- a/src/ripple/app/paths/cursor/ForwardLiquidityForAccount.cpp +++ b/src/ripple/app/paths/cursor/ForwardLiquidityForAccount.cpp @@ -353,7 +353,7 @@ TER PathCursor::forwardLiquidityForAccount () const ledger().accountHolds ( node().account_, xrpCurrency(), - xrpAccount(), + xrpAccount(), fhIGNORE_FREEZE)); // XRP can't be frozen } diff --git a/src/ripple/app/peers/PeerSet.h b/src/ripple/app/peers/PeerSet.h index 1721b5e06..8eb5d45c5 100644 --- a/src/ripple/app/peers/PeerSet.h +++ b/src/ripple/app/peers/PeerSet.h @@ -61,22 +61,22 @@ public: mProgress = true; mAggressive = false; } - + void clearProgress () { mProgress = false; } - + bool isProgress () { return mProgress; } - + void touch () { mLastAction = m_clock.now(); } - + clock_type::time_point getLastAction () const { return mLastAction; diff --git a/src/ripple/app/shamap/SHAMapDelta.cpp b/src/ripple/app/shamap/SHAMapDelta.cpp index 05883b764..f6b78f5ab 100644 --- a/src/ripple/app/shamap/SHAMapDelta.cpp +++ b/src/ripple/app/shamap/SHAMapDelta.cpp @@ -175,7 +175,7 @@ bool SHAMap::compare (SHAMap::ref otherMap, Delta& differences, int maxCount) else if (ourNode->isLeaf () && otherNode->isInner ()) { if (!otherMap->walkBranch (otherNode, ourNode->peekItem (), - false, differences, maxCount)) + false, differences, maxCount)) return false; } else if (ourNode->isInner () && otherNode->isInner ()) @@ -233,20 +233,20 @@ void SHAMap::walkMap (std::vector& missingNodes, int maxMissi { if (!node->isEmptyBranch (i)) { - SHAMapTreeNode::pointer nextNode = descendNoStore (node, i); + SHAMapTreeNode::pointer nextNode = descendNoStore (node, i); - if (nextNode) - { - if (nextNode->isInner ()) - nodeStack.push (std::move (nextNode)); - } - else - { - missingNodes.emplace_back (mType, node->getChildHash (i)); - if (--maxMissing <= 0) - return; - } - } + if (nextNode) + { + if (nextNode->isInner ()) + nodeStack.push (std::move (nextNode)); + } + else + { + missingNodes.emplace_back (mType, node->getChildHash (i)); + if (--maxMissing <= 0) + return; + } + } } } } diff --git a/src/ripple/app/transactors/AddWallet.cpp b/src/ripple/app/transactors/AddWallet.cpp index 98e925264..931c963b4 100644 --- a/src/ripple/app/transactors/AddWallet.cpp +++ b/src/ripple/app/transactors/AddWallet.cpp @@ -26,7 +26,7 @@ public: AddWallet ( SerializedTransaction const& txn, TransactionEngineParams params, - TransactionEngine* engine) + TransactionEngine* engine) : Transactor ( txn, params, diff --git a/src/ripple/app/transactors/CancelTicket.cpp b/src/ripple/app/transactors/CancelTicket.cpp index 6fcfe1140..856ba2119 100644 --- a/src/ripple/app/transactors/CancelTicket.cpp +++ b/src/ripple/app/transactors/CancelTicket.cpp @@ -48,7 +48,7 @@ public: return tecNO_ENTRY; Account const ticket_owner (sleTicket->getFieldAccount160 (sfAccount)); - + bool authorized (mTxnAccountID == ticket_owner); // The target can also always remove a ticket diff --git a/src/ripple/app/transactors/Change.cpp b/src/ripple/app/transactors/Change.cpp index 8b2f199a0..7b47d4adc 100644 --- a/src/ripple/app/transactors/Change.cpp +++ b/src/ripple/app/transactors/Change.cpp @@ -148,7 +148,7 @@ private: feeObject = mEngine->entryCreate ( ltFEE_SETTINGS, Ledger::getLedgerFeeIndex ()); - m_journal.trace << + m_journal.trace << "Previous fee object: " << feeObject->getJson (0); feeObject->setFieldU64 ( @@ -162,7 +162,7 @@ private: mEngine->entryModify (feeObject); - m_journal.trace << + m_journal.trace << "New fee object: " << feeObject->getJson (0); m_journal.warning << "Fees have been changed"; return tesSUCCESS; diff --git a/src/ripple/app/transactors/CreateOffer.cpp b/src/ripple/app/transactors/CreateOffer.cpp index 885c44f38..3ae201722 100644 --- a/src/ripple/app/transactors/CreateOffer.cpp +++ b/src/ripple/app/transactors/CreateOffer.cpp @@ -588,7 +588,7 @@ transact_CreateOffer ( { // Autobridging is performed only when the offer does not involve XRP bool autobridging = - ! txn.getFieldAmount (sfTakerPays).isNative() && + ! txn.getFieldAmount (sfTakerPays).isNative() && ! txn.getFieldAmount (sfTakerGets).isNative (); return CreateOffer (autobridging, txn, params, engine).apply (); diff --git a/src/ripple/app/transactors/Payment.cpp b/src/ripple/app/transactors/Payment.cpp index 56fdf70bf..5f719d0a1 100644 --- a/src/ripple/app/transactors/Payment.cpp +++ b/src/ripple/app/transactors/Payment.cpp @@ -21,7 +21,7 @@ namespace ripple { // See https://ripple.com/wiki/Transaction_Format#Payment_.280.29 -class Payment +class Payment : public Transactor { /* The largest number of paths we allow */ diff --git a/src/ripple/app/transactors/SetTrust.cpp b/src/ripple/app/transactors/SetTrust.cpp index b5b03f63d..b9c0c32c7 100644 --- a/src/ripple/app/transactors/SetTrust.cpp +++ b/src/ripple/app/transactors/SetTrust.cpp @@ -50,7 +50,7 @@ public: bool const bHigh = mTxnAccountID > uDstAccountID; std::uint32_t const uOwnerCount (mTxnAccount->getFieldU32 (sfOwnerCount)); - + // The reserve required to create the line. Note that we allow up to // two trust lines without requiring a reserve because being able to // exchange currencies is a powerful Ripple feature. diff --git a/src/ripple/app/transactors/Transactor.cpp b/src/ripple/app/transactors/Transactor.cpp index beaf87a1d..8b116f574 100644 --- a/src/ripple/app/transactors/Transactor.cpp +++ b/src/ripple/app/transactors/Transactor.cpp @@ -250,7 +250,7 @@ TER Transactor::preCheck () // Consistency: really signed. if (!mTxn.isKnownGood ()) { - if (mTxn.isKnownBad () || + if (mTxn.isKnownBad () || (!(mParams & tapNO_CHECK_SIGN) && !mTxn.checkSign (mSigningPubKey))) { mTxn.setBad (); diff --git a/src/ripple/app/websocket/WSDoor.cpp b/src/ripple/app/websocket/WSDoor.cpp index 36a89dacc..a0241f587 100644 --- a/src/ripple/app/websocket/WSDoor.cpp +++ b/src/ripple/app/websocket/WSDoor.cpp @@ -94,7 +94,7 @@ private: WriteLog (lsWARNING, WSDoor) << "websocketpp exception: " << e.what (); // temporary workaround for websocketpp throwing exceptions on access/close races - for (;;) + for (;;) { // https://github.com/zaphoyd/websocketpp/issues/98 try @@ -140,7 +140,7 @@ private: private: typedef RippleRecursiveMutex LockType; typedef std::lock_guard ScopedLockType; - + Resource::Manager& m_resourceManager; InfoSub::Source& m_source; boost::asio::ssl::context& m_ssl_context; diff --git a/src/ripple/basics/Log.h b/src/ripple/basics/Log.h index 4bf0f29b8..8f389eaaf 100644 --- a/src/ripple/basics/Log.h +++ b/src/ripple/basics/Log.h @@ -128,7 +128,7 @@ private: { write (str.c_str ()); } - + void writeln (std::string const& str) { writeln (str.c_str ()); @@ -150,7 +150,7 @@ public: Logs (Logs const&) = delete; Logs& operator= (Logs const&) = delete; - + bool open (boost::filesystem::path const& pathToLogFile); diff --git a/src/ripple/basics/LoggedTimings.h b/src/ripple/basics/LoggedTimings.h index e9032d557..ebbd47573 100644 --- a/src/ripple/basics/LoggedTimings.h +++ b/src/ripple/basics/LoggedTimings.h @@ -24,7 +24,7 @@ #include #include #include - + namespace ripple { namespace detail { diff --git a/src/ripple/basics/impl/Log.cpp b/src/ripple/basics/impl/Log.cpp index ad556c1e4..e01a3c6f5 100644 --- a/src/ripple/basics/impl/Log.cpp +++ b/src/ripple/basics/impl/Log.cpp @@ -110,7 +110,7 @@ Logs::Logs() : level_ (beast::Journal::kWarning) // default severity { } - + bool Logs::open (boost::filesystem::path const& pathToLogFile) { diff --git a/src/ripple/basics/impl/RangeSet.cpp b/src/ripple/basics/impl/RangeSet.cpp index 5f2cd495c..af172e7ce 100644 --- a/src/ripple/basics/impl/RangeSet.cpp +++ b/src/ripple/basics/impl/RangeSet.cpp @@ -130,7 +130,7 @@ void RangeSet::setValue (std::uint32_t v) if (!hasValue (v)) { mRanges[v] = v; - + simplify (); } } diff --git a/src/ripple/basics/impl/Sustain.cpp b/src/ripple/basics/impl/Sustain.cpp index 634306b5f..a147624ec 100644 --- a/src/ripple/basics/impl/Sustain.cpp +++ b/src/ripple/basics/impl/Sustain.cpp @@ -18,7 +18,7 @@ //============================================================================== #include - + // For Sustain Linux variants // VFALCO TODO Rewrite Sustain to use beast::Process #ifdef __linux__ diff --git a/src/ripple/common/MultiSocket.h b/src/ripple/common/MultiSocket.h index b917bd0ac..03d1c08fd 100644 --- a/src/ripple/common/MultiSocket.h +++ b/src/ripple/common/MultiSocket.h @@ -70,7 +70,7 @@ public: { return m_flags == other.m_flags; } - + inline bool set (int mask) const noexcept { return (m_flags & mask) == mask; diff --git a/src/ripple/common/TaggedCache.h b/src/ripple/common/TaggedCache.h index bb725ab87..0dc20a92d 100644 --- a/src/ripple/common/TaggedCache.h +++ b/src/ripple/common/TaggedCache.h @@ -170,7 +170,7 @@ public: // so that we can destroy them outside the lock. // std::vector stuffToSweep; - + { clock_type::time_point const now (m_clock.now()); clock_type::time_point when_expire; @@ -448,7 +448,7 @@ public: } else { - // Couldn't get strong pointer, + // Couldn't get strong pointer, // object fell out of the cache so remove the entry. m_cache.erase (cit); } diff --git a/src/ripple/common/impl/KeyCache.cpp b/src/ripple/common/impl/KeyCache.cpp index 80a3794dd..e30e9a2c6 100644 --- a/src/ripple/common/impl/KeyCache.cpp +++ b/src/ripple/common/impl/KeyCache.cpp @@ -34,7 +34,7 @@ public: typedef std::string Key; typedef KeyCache Cache; - + // Insert an item, retrieve it, and age it so it gets purged. { Cache c ("test", clock, 1, 2); diff --git a/src/ripple/common/impl/MultiSocketImpl.h b/src/ripple/common/impl/MultiSocketImpl.h index 197441f96..472b460cc 100644 --- a/src/ripple/common/impl/MultiSocketImpl.h +++ b/src/ripple/common/impl/MultiSocketImpl.h @@ -138,7 +138,7 @@ protected: return beast::IP::Endpoint(); } - try + try { return beast::IPAddressConversion::from_asio ( m_next_layer.remote_endpoint()); @@ -300,7 +300,7 @@ protected: */ bool needs_handshake () override { - return m_state == stateHandshake || + return m_state == stateHandshake || m_state == stateHandshakeFinal || m_needsShutdown; } diff --git a/src/ripple/common/impl/ResolverAsio.cpp b/src/ripple/common/impl/ResolverAsio.cpp index 0b947ab02..4e0a9e9ae 100644 --- a/src/ripple/common/impl/ResolverAsio.cpp +++ b/src/ripple/common/impl/ResolverAsio.cpp @@ -196,7 +196,7 @@ public: // Attempt to find the first and last non-whitespace auto const find_whitespace = std::bind ( &std::isspace , - std::placeholders::_1, + std::placeholders::_1, std::locale ()); auto host_first = std::find_if_not ( diff --git a/src/ripple/common/impl/RippleSSLContext.cpp b/src/ripple/common/impl/RippleSSLContext.cpp index d3f2b4048..cfbf6c157 100644 --- a/src/ripple/common/impl/RippleSSLContext.cpp +++ b/src/ripple/common/impl/RippleSSLContext.cpp @@ -204,7 +204,7 @@ public: if (! cert_file.empty ()) { boost::system::error_code ec; - + m_context.use_certificate_file ( cert_file, boost::asio::ssl::context::pem, ec); diff --git a/src/ripple/common/impl/TaggedCache.cpp b/src/ripple/common/impl/TaggedCache.cpp index a2f00ea45..c3956cfa2 100644 --- a/src/ripple/common/impl/TaggedCache.cpp +++ b/src/ripple/common/impl/TaggedCache.cpp @@ -47,7 +47,7 @@ public: typedef int Key; typedef std::string Value; typedef TaggedCache Cache; - + Cache c ("test", 1, 1, clock, j); // Insert an item, retrieve it, and age it so it gets purged. diff --git a/src/ripple/common/tests/MultiSocket.test.cpp b/src/ripple/common/tests/MultiSocket.test.cpp index 4e4429154..b5d9b42b8 100644 --- a/src/ripple/common/tests/MultiSocket.test.cpp +++ b/src/ripple/common/tests/MultiSocket.test.cpp @@ -171,7 +171,7 @@ public: }; //-------------------------------------------------------------------------- - + template void runProxy (ClientArg const& clientArg, ServerArg const& serverArg) { diff --git a/src/ripple/common/tests/cross_offer.test.cpp b/src/ripple/common/tests/cross_offer.test.cpp index 0720088ca..58d546442 100644 --- a/src/ripple/common/tests/cross_offer.test.cpp +++ b/src/ripple/common/tests/cross_offer.test.cpp @@ -48,12 +48,12 @@ namespace core { `X::amount_type` The return type of `in` and `out` - + `X a;` Constructs an uninitialized offer - + `a.in();` - + `a.out(); */ @@ -424,11 +424,11 @@ public: if (! iter_eq (m_leg1, m_leg1_end, other.m_leg1, other.m_leg1_end)) return false; - + if (! iter_eq (m_leg2, m_leg2_end, other.m_leg2, other.m_leg2_end)) return false; - + return true; } @@ -498,7 +498,7 @@ public: typedef detail::MultiBookIterator < typename Book::iterator> iterator; - + typedef detail::MultiBookIterator < typename Book::const_iterator> const_iterator; @@ -643,7 +643,7 @@ public: return m_in; } - Amount const& + Amount const& out() const noexcept { return m_out; @@ -805,7 +805,7 @@ public: run() { test_iterators(); - + test_full_cross_direct (); test_full_cross_auto_direct (); test_full_cross_auto_bridge (); diff --git a/src/ripple/core/JobTypeData.h b/src/ripple/core/JobTypeData.h index 1cfa89a1f..105f95037 100644 --- a/src/ripple/core/JobTypeData.h +++ b/src/ripple/core/JobTypeData.h @@ -50,7 +50,7 @@ public: beast::insight::Event dequeue; beast::insight::Event execute; - explicit JobTypeData (JobTypeInfo const& info_, + explicit JobTypeData (JobTypeInfo const& info_, beast::insight::Collector::ptr const& collector) noexcept : m_collector (collector) , info (info_) diff --git a/src/ripple/core/JobTypeInfo.h b/src/ripple/core/JobTypeInfo.h index 961150356..66a9f3b1d 100644 --- a/src/ripple/core/JobTypeInfo.h +++ b/src/ripple/core/JobTypeInfo.h @@ -47,8 +47,8 @@ public: // Not default constructible JobTypeInfo () = delete; - JobTypeInfo (JobType type, std::string name, int limit, - bool skip, bool special, std::uint64_t avgLatency, std::uint64_t peakLatency) + JobTypeInfo (JobType type, std::string name, int limit, + bool skip, bool special, std::uint64_t avgLatency, std::uint64_t peakLatency) : m_type (type) , m_name (name) , m_limit (limit) diff --git a/src/ripple/core/impl/Config.cpp b/src/ripple/core/impl/Config.cpp index f1d12e252..0eecbce69 100644 --- a/src/ripple/core/impl/Config.cpp +++ b/src/ripple/core/impl/Config.cpp @@ -31,7 +31,7 @@ #include #include #include - + #ifndef DUMP_CONFIG #define DUMP_CONFIG 0 #endif @@ -794,7 +794,7 @@ boost::filesystem::path Config::getDebugLogFile () const // decide how to handle this situation. if (ec) { - std::cerr << + std::cerr << "Unable to create log file path " << log_dir << ": " << ec.message() << '\n'; } diff --git a/src/ripple/core/impl/LoadMonitor.cpp b/src/ripple/core/impl/LoadMonitor.cpp index 62bc797c5..5a8dce039 100644 --- a/src/ripple/core/impl/LoadMonitor.cpp +++ b/src/ripple/core/impl/LoadMonitor.cpp @@ -86,7 +86,7 @@ void LoadMonitor::update () // do exponential decay /* David: - + "Imagine if you add 10 to something every second. And you also reduce it by 1/4 every second. It will "idle" at 40, correponding to 10 counts per second." diff --git a/src/ripple/data/crypto/Base58Data.cpp b/src/ripple/data/crypto/Base58Data.cpp index 14ab2f3e9..edcc95216 100644 --- a/src/ripple/data/crypto/Base58Data.cpp +++ b/src/ripple/data/crypto/Base58Data.cpp @@ -45,7 +45,7 @@ CBase58Data::~CBase58Data () bool CBase58Data::SetString ( std::string const& str, - unsigned char version, + unsigned char version, Base58::Alphabet const& alphabet) { Blob vchTemp; diff --git a/src/ripple/data/protocol/SField.h b/src/ripple/data/protocol/SField.h index f00d40caf..f04ca4613 100644 --- a/src/ripple/data/protocol/SField.h +++ b/src/ripple/data/protocol/SField.h @@ -135,7 +135,7 @@ public: , signingField (std::move(sf.signingField)) , rawJsonName (std::move(sf.rawJsonName)) , jsonName (rawJsonName.c_str ()) - {} + {} #endif private: diff --git a/src/ripple/data/protocol/STAmount.h b/src/ripple/data/protocol/STAmount.h index e75827781..b48ba7df1 100644 --- a/src/ripple/data/protocol/STAmount.h +++ b/src/ripple/data/protocol/STAmount.h @@ -155,7 +155,7 @@ public: { return mValue ? (mIsNegative ? -1 : 1) : 0; } - + /** Returns a zero value with the same issuer and currency. */ STAmount zeroed() const @@ -186,7 +186,7 @@ public: // Operators // //-------------------------------------------------------------------------- - + explicit operator bool() const noexcept { return *this != zero; @@ -284,7 +284,7 @@ public: void add (Serializer& s) const override; - + bool isEquivalent (const SerializedType& t) const override; diff --git a/src/ripple/data/protocol/STAmount.test.cpp b/src/ripple/data/protocol/STAmount.test.cpp index 5c46e16ce..e7ee78cf9 100644 --- a/src/ripple/data/protocol/STAmount.test.cpp +++ b/src/ripple/data/protocol/STAmount.test.cpp @@ -115,7 +115,7 @@ public: std::string const& value, Issue const& issue, bool success = true) { STAmount amount (issue); - + bool const result = amount.setValue (value); expect (result == success, "parse " + value); @@ -175,7 +175,7 @@ public: testSetValue ("100000000", usd); testSetValue ("1000000000", usd); testSetValue ("10000000000", usd); - + testSetValue ("1234567.1", usd); testSetValue ("1234567.12", usd); testSetValue ("1234567.123", usd); diff --git a/src/ripple/data/protocol/SerializedType.h b/src/ripple/data/protocol/SerializedType.h index 66f3c019d..6642eaf14 100644 --- a/src/ripple/data/protocol/SerializedType.h +++ b/src/ripple/data/protocol/SerializedType.h @@ -107,7 +107,7 @@ public: { return std::string(); } - + virtual Json::Value getJson (int /*options*/) const { diff --git a/src/ripple/data/protocol/TxFormats.cpp b/src/ripple/data/protocol/TxFormats.cpp index abd6d51d8..3bad340c5 100644 --- a/src/ripple/data/protocol/TxFormats.cpp +++ b/src/ripple/data/protocol/TxFormats.cpp @@ -89,15 +89,15 @@ void TxFormats::addCommonFields (Item& item) << SOElement(sfTransactionType, SOE_REQUIRED) << SOElement(sfFlags, SOE_OPTIONAL) << SOElement(sfSourceTag, SOE_OPTIONAL) - << SOElement(sfAccount, SOE_REQUIRED) - << SOElement(sfSequence, SOE_REQUIRED) + << SOElement(sfAccount, SOE_REQUIRED) + << SOElement(sfSequence, SOE_REQUIRED) << SOElement(sfPreviousTxnID, SOE_OPTIONAL) // Deprecated: Do not use << SOElement(sfLastLedgerSequence, SOE_OPTIONAL) << SOElement(sfAccountTxnID, SOE_OPTIONAL) - << SOElement(sfFee, SOE_REQUIRED) - << SOElement(sfOperationLimit, SOE_OPTIONAL) + << SOElement(sfFee, SOE_REQUIRED) + << SOElement(sfOperationLimit, SOE_OPTIONAL) << SOElement(sfMemos, SOE_OPTIONAL) - << SOElement(sfSigningPubKey, SOE_REQUIRED) + << SOElement(sfSigningPubKey, SOE_REQUIRED) << SOElement(sfTxnSignature, SOE_OPTIONAL) ; } diff --git a/src/ripple/http/Session.h b/src/ripple/http/Session.h index 31dc2f589..0e20c699d 100644 --- a/src/ripple/http/Session.h +++ b/src/ripple/http/Session.h @@ -138,7 +138,7 @@ public: { return ScopedStream (*this, manip); } - + template ScopedStream operator<< (T const& t) diff --git a/src/ripple/http/impl/Peer.h b/src/ripple/http/impl/Peer.h index 641f9f31a..b976402e6 100644 --- a/src/ripple/http/impl/Peer.h +++ b/src/ripple/http/impl/Peer.h @@ -298,7 +298,7 @@ public: accept(); private: - void + void do_handshake (boost::asio::yield_context yield); void diff --git a/src/ripple/http/impl/ServerImpl.h b/src/ripple/http/impl/ServerImpl.h index a22972fcb..b8addf8b3 100644 --- a/src/ripple/http/impl/ServerImpl.h +++ b/src/ripple/http/impl/ServerImpl.h @@ -144,12 +144,12 @@ private: ceil_log2 (unsigned long long x); static - int + int compare (Port const& lhs, Port const& rhs); void update(); - + void on_update(); diff --git a/src/ripple/json/impl/Tests.cpp b/src/ripple/json/impl/Tests.cpp index 0adf66018..a91f1bf86 100644 --- a/src/ripple/json/impl/Tests.cpp +++ b/src/ripple/json/impl/Tests.cpp @@ -45,7 +45,7 @@ public: std::uint32_t max_uint = std::numeric_limits::max (); std::int32_t max_int = std::numeric_limits::max (); std::int32_t min_int = std::numeric_limits::min (); - + std::uint32_t a_uint = max_uint - 1978; std::int32_t a_large_int = max_int - 1978; std::int32_t a_small_int = min_int + 1978; diff --git a/src/ripple/json/impl/json_reader.cpp b/src/ripple/json/impl/json_reader.cpp index 8951d0988..c40c9e5cc 100644 --- a/src/ripple/json/impl/json_reader.cpp +++ b/src/ripple/json/impl/json_reader.cpp @@ -703,7 +703,7 @@ Reader::decodeNumber ( Token& token ) // More tokens left -> input is larger than largest possible return value if (current != token.end_) { - return addError ( "'" + std::string ( token.start_, token.end_ ) + + return addError ( "'" + std::string ( token.start_, token.end_ ) + "' exceeds the allowable range.", token ); } @@ -713,7 +713,7 @@ Reader::decodeNumber ( Token& token ) if (value < Value::minInt || value > Value::maxInt) { - return addError ( "'" + std::string ( token.start_, token.end_ ) + + return addError ( "'" + std::string ( token.start_, token.end_ ) + "' exceeds the allowable range.", token ); } @@ -723,7 +723,7 @@ Reader::decodeNumber ( Token& token ) { if (value > Value::maxUInt) { - return addError ( "'" + std::string ( token.start_, token.end_ ) + + return addError ( "'" + std::string ( token.start_, token.end_ ) + "' exceeds the allowable range.", token ); } diff --git a/src/ripple/nodestore/Backend.h b/src/ripple/nodestore/Backend.h index 8b7c2fb14..b21fbee7b 100644 --- a/src/ripple/nodestore/Backend.h +++ b/src/ripple/nodestore/Backend.h @@ -68,7 +68,7 @@ public: */ virtual void store (NodeObject::Ptr const& object) = 0; - /** Store a group of objects. + /** Store a group of objects. @note This function will not be called concurrently with itself or @ref store. */ diff --git a/src/ripple/nodestore/Database.h b/src/ripple/nodestore/Database.h index c10096b40..70120ea0c 100644 --- a/src/ripple/nodestore/Database.h +++ b/src/ripple/nodestore/Database.h @@ -59,7 +59,7 @@ public: `nullptr` is returned. @note This can be called concurrently. - @param hash The key of the object to retrieve. + @param hash The key of the object to retrieve. @return The object, or nullptr if it couldn't be retrieved. */ virtual NodeObject::pointer fetch (uint256 const& hash) = 0; @@ -96,7 +96,7 @@ public: variable is overwritten. @param hash The 256-bit hash of the payload data. - @return `true` if the object was stored? + @return `true` if the object was stored? */ virtual void store (NodeObjectType type, std::uint32_t ledgerIndex, @@ -124,7 +124,7 @@ public: virtual float getCacheHitRate () = 0; /** Set the maximum number of entries and maximum cache age for both caches. - + @param size Number of cache entries (0 = ignore) @param age Maximum cache age in seconds */ diff --git a/src/ripple/nodestore/Manager.h b/src/ripple/nodestore/Manager.h index e4079dc14..f316dd258 100644 --- a/src/ripple/nodestore/Manager.h +++ b/src/ripple/nodestore/Manager.h @@ -50,7 +50,7 @@ public: The parameters are key value pairs passed to the backend. The 'type' key must exist, it defines the choice of backend. Most backends also require a 'path' field. - + Some choices for 'type' are: HyperLevelDB, LevelDBFactory, SQLite, MDB diff --git a/src/ripple/nodestore/NodeObject.h b/src/ripple/nodestore/NodeObject.h index 9b8fad07e..a9c6476bc 100644 --- a/src/ripple/nodestore/NodeObject.h +++ b/src/ripple/nodestore/NodeObject.h @@ -37,10 +37,10 @@ enum NodeObjectType hotTRANSACTION_NODE = 4 }; -/** A simple object that the Ledger uses to store entries. - NodeObjects are comprised of a type, a hash, a ledger index and a blob. - They can be uniquely identified by the hash, which is a SHA 256 of the - blob. The blob is a variable length block of serialized data. The type +/** A simple object that the Ledger uses to store entries. + NodeObjects are comprised of a type, a hash, a ledger index and a blob. + They can be uniquely identified by the hash, which is a SHA 256 of the + blob. The blob is a variable length block of serialized data. The type identifies what the blob contains. @note No checking is performed to make sure the hash matches the data. diff --git a/src/ripple/nodestore/Scheduler.h b/src/ripple/nodestore/Scheduler.h index c594a91b6..9aab6a7da 100644 --- a/src/ripple/nodestore/Scheduler.h +++ b/src/ripple/nodestore/Scheduler.h @@ -42,7 +42,7 @@ struct BatchWriteReport }; /** Scheduling for asynchronous backend activity - + For improved performance, a backend has the option of performing writes in batches. These writes can be scheduled using the provided scheduler object. diff --git a/src/ripple/nodestore/backend/LevelDBFactory.cpp b/src/ripple/nodestore/backend/LevelDBFactory.cpp index b74b34147..c2a80d535 100644 --- a/src/ripple/nodestore/backend/LevelDBFactory.cpp +++ b/src/ripple/nodestore/backend/LevelDBFactory.cpp @@ -260,7 +260,7 @@ public: return "LevelDB"; } - std::unique_ptr + std::unique_ptr createInstance( size_t keyBytes, Parameters const& keyValues, diff --git a/src/ripple/nodestore/backend/NullFactory.cpp b/src/ripple/nodestore/backend/NullFactory.cpp index fbd10e729..ef6dcc2a8 100644 --- a/src/ripple/nodestore/backend/NullFactory.cpp +++ b/src/ripple/nodestore/backend/NullFactory.cpp @@ -37,17 +37,17 @@ public: return std::string (); } - Status + Status fetch (void const*, NodeObject::Ptr*) { return notFound; } - + void store (NodeObject::ref object) { } - + void storeBatch (Batch const& batch) { diff --git a/src/ripple/nodestore/backend/RocksDBFactory.cpp b/src/ripple/nodestore/backend/RocksDBFactory.cpp index 26fc886a3..7b1bfb31b 100644 --- a/src/ripple/nodestore/backend/RocksDBFactory.cpp +++ b/src/ripple/nodestore/backend/RocksDBFactory.cpp @@ -45,7 +45,7 @@ public: void (*f)(void*); void* a; }; - + static void thread_entry (void* ptr) @@ -194,7 +194,7 @@ public: { } - std::string + std::string getName() { return m_name; @@ -363,7 +363,7 @@ public: return "RocksDB"; } - std::unique_ptr + std::unique_ptr createInstance ( size_t keyBytes, Parameters const& keyValues, diff --git a/src/ripple/nodestore/impl/Manager.cpp b/src/ripple/nodestore/impl/Manager.cpp index af5c598c1..c24635e5c 100644 --- a/src/ripple/nodestore/impl/Manager.cpp +++ b/src/ripple/nodestore/impl/Manager.cpp @@ -39,7 +39,7 @@ public: ~ManagerImp () { } - + void add_factory (std::unique_ptr factory) { diff --git a/src/ripple/nodestore/tests/DatabaseTests.cpp b/src/ripple/nodestore/tests/DatabaseTests.cpp index 24785933b..1c9ae8946 100644 --- a/src/ripple/nodestore/tests/DatabaseTests.cpp +++ b/src/ripple/nodestore/tests/DatabaseTests.cpp @@ -23,7 +23,7 @@ namespace NodeStore { class NodeStoreDatabase_test : public TestBase { public: - void testImport (std::string const& destBackendType, + void testImport (std::string const& destBackendType, std::string const& srcBackendType, std::int64_t seedValue) { std::unique_ptr manager (make_Manager ()); diff --git a/src/ripple/overlay/Message.h b/src/ripple/overlay/Message.h index f5da39857..a4491a7c3 100644 --- a/src/ripple/overlay/Message.h +++ b/src/ripple/overlay/Message.h @@ -21,7 +21,7 @@ #define RIPPLE_OVERLAY_MESSAGE_H_INCLUDED #include "ripple.pb.h" - + #include namespace ripple { diff --git a/src/ripple/overlay/impl/OverlayImpl.h b/src/ripple/overlay/impl/OverlayImpl.h index b60a89821..28aba5e06 100644 --- a/src/ripple/overlay/impl/OverlayImpl.h +++ b/src/ripple/overlay/impl/OverlayImpl.h @@ -45,7 +45,7 @@ class PeerDoor; class PeerImp; class OverlayImpl : public Overlay -{ +{ private: using clock_type = std::chrono::steady_clock; using socket_type = boost::asio::ip::tcp::socket; @@ -146,10 +146,10 @@ public: void check_stopped (); - + void release (); - + void remove (PeerFinder::Slot::ptr const& slot); @@ -164,7 +164,7 @@ public: onStart () override; /** Close all peer connections. - If `graceful` is true then active + If `graceful` is true then active Requirements: Caller must hold the mutex. */ diff --git a/src/ripple/overlay/impl/PeerImp.cpp b/src/ripple/overlay/impl/PeerImp.cpp index 4b876cf43..52e80ba37 100644 --- a/src/ripple/overlay/impl/PeerImp.cpp +++ b/src/ripple/overlay/impl/PeerImp.cpp @@ -296,7 +296,7 @@ PeerImp::hasRange (std::uint32_t uMin, std::uint32_t uMax) 3. Send HTTP request 4. Receive HTTP response 5. Enter protocol loop -*/ +*/ void PeerImp::do_connect () { @@ -396,7 +396,7 @@ PeerImp::on_connect_ssl (error_code ec) #if RIPPLE_STRUCTURED_OVERLAY_CLIENT beast::http::message req (make_request()); - beast::http::write (write_buffer_, req); + beast::http::write (write_buffer_, req); on_write_http_request (error_code(), 0); #else @@ -567,7 +567,7 @@ PeerImp::on_read_http_detect (error_code ec, std::size_t bytes_transferred) read_buffer_.commit (bytes_transferred); peer_protocol_detector detector; boost::tribool const is_peer_protocol (detector (read_buffer_.data())); - + if (is_peer_protocol) { do_protocol_start(); @@ -615,7 +615,7 @@ PeerImp::on_read_http_request (error_code ec, std::size_t bytes_transferred) if (http_message_->upgrade()) { std::stringstream ss; - ss << + ss << "HTTP/1.1 200 OK\r\n" "Server: " << BuildInfo::getFullVersionString() << "\r\n" "Upgrade: Ripple/1.2\r\n" @@ -627,7 +627,7 @@ PeerImp::on_read_http_request (error_code ec, std::size_t bytes_transferred) else { std::stringstream ss; - ss << + ss << "HTTP/1.1 400 Bad Request\r\n" "Server: " << BuildInfo::getFullVersionString() << "\r\n" "\r\n" @@ -1284,8 +1284,8 @@ PeerImp::on_message (std::shared_ptr const& m) // For now, be paranoid and have each validator // check each transaction, regardless of source flags |= SF_SIGGOOD; - } - } + } + } if (getApp().getJobQueue().getJobCount(jtTRANSACTION) > 100) journal_.info << "Transaction queue is full"; diff --git a/src/ripple/overlay/impl/PeerImp.h b/src/ripple/overlay/impl/PeerImp.h index a274f2be8..69e685e15 100644 --- a/src/ripple/overlay/impl/PeerImp.h +++ b/src/ripple/overlay/impl/PeerImp.h @@ -131,7 +131,7 @@ private: State state_; // Current state bool detaching_ = false; - + // True if peer is a node in our cluster bool clusterNode_ = false; @@ -175,7 +175,7 @@ private: message_stream message_stream_; boost::asio::streambuf write_buffer_; - + std::unique_ptr load_event_; //-------------------------------------------------------------------------- @@ -241,7 +241,7 @@ public: Peer::ShortId getShortId () const override; - + RippleAddress const& getNodePublic () const override; diff --git a/src/ripple/peerfinder/Manager.h b/src/ripple/peerfinder/Manager.h index 50d5cfb49..217202c8c 100644 --- a/src/ripple/peerfinder/Manager.h +++ b/src/ripple/peerfinder/Manager.h @@ -67,7 +67,7 @@ struct Config /** The set of features we advertise. */ std::string features; - + //-------------------------------------------------------------------------- /** Create a configuration with default values. */ diff --git a/src/ripple/peerfinder/impl/Checker.h b/src/ripple/peerfinder/impl/Checker.h index dae5898bd..b45faf430 100644 --- a/src/ripple/peerfinder/impl/Checker.h +++ b/src/ripple/peerfinder/impl/Checker.h @@ -31,7 +31,7 @@ #include #include #include - + namespace ripple { namespace PeerFinder { diff --git a/src/ripple/peerfinder/impl/Counts.h b/src/ripple/peerfinder/impl/Counts.h index 27afc131e..58f772ff2 100644 --- a/src/ripple/peerfinder/impl/Counts.h +++ b/src/ripple/peerfinder/impl/Counts.h @@ -316,7 +316,7 @@ private: /** Active outbound slots. */ std::size_t m_out_active; - + /** Fixed connections. */ std::size_t m_fixed; diff --git a/src/ripple/peerfinder/impl/Handouts.h b/src/ripple/peerfinder/impl/Handouts.h index 5747d5a76..4c1a7dadb 100644 --- a/src/ripple/peerfinder/impl/Handouts.h +++ b/src/ripple/peerfinder/impl/Handouts.h @@ -345,7 +345,7 @@ ConnectHandouts::try_insert (beast::IP::Endpoint const& endpoint) endpoint.address())); if (! result.second) return false; - + m_list.push_back (endpoint); return true; diff --git a/src/ripple/peerfinder/impl/Livecache.h b/src/ripple/peerfinder/impl/Livecache.h index aa44b9bfa..2649be673 100644 --- a/src/ripple/peerfinder/impl/Livecache.h +++ b/src/ripple/peerfinder/impl/Livecache.h @@ -167,7 +167,7 @@ protected: //------------------------------------------------------------------------------ /** The Livecache holds the short-lived relayed Endpoint messages. - + Since peers only advertise themselves when they have open slots, we want these messags to expire rather quickly after the peer becomes full. diff --git a/src/ripple/peerfinder/impl/SlotImp.h b/src/ripple/peerfinder/impl/SlotImp.h index 0a7d94f86..336f5039f 100644 --- a/src/ripple/peerfinder/impl/SlotImp.h +++ b/src/ripple/peerfinder/impl/SlotImp.h @@ -162,7 +162,7 @@ public: // Set to indicate that a connection check for this peer is in // progress. Valid always. bool connectivityCheckInProgress; - + // The time after which we will accept mtENDPOINTS from the peer // This is to prevent flooding or spamming. Receipt of mtENDPOINTS // sooner than the allotted time should impose a load charge. diff --git a/src/ripple/peerfinder/sim/GraphAlgorithms.h b/src/ripple/peerfinder/sim/GraphAlgorithms.h index 44c8f705c..b7c8b20cf 100644 --- a/src/ripple/peerfinder/sim/GraphAlgorithms.h +++ b/src/ripple/peerfinder/sim/GraphAlgorithms.h @@ -38,7 +38,7 @@ void breadth_first_traverse (Vertex& start, Function f) typedef VertexTraits Traits; typedef typename Traits::Edges Edges; typedef typename Traits::Edge Edge; - + typedef std::pair Probe; typedef std::deque Work; typedef std::set Visited; @@ -73,4 +73,4 @@ void breadth_first_traverse (Vertex& start, Function f) } } -#endif \ No newline at end of file +#endif diff --git a/src/ripple/peerfinder/sim/Tests.cpp b/src/ripple/peerfinder/sim/Tests.cpp index eb986d844..d24a56454 100644 --- a/src/ripple/peerfinder/sim/Tests.cpp +++ b/src/ripple/peerfinder/sim/Tests.cpp @@ -112,7 +112,7 @@ public: Node const& remote_node () const { return *m_remote_node; } Node& local_node () { return *m_local_node; } Node const& local_node () const { return *m_local_node; } - + void post (Message const& m) { m_pending.push_back (m); @@ -164,7 +164,7 @@ public: : canAccept (true) { } - + bool canAccept; IP::Endpoint listening_endpoint; IP::Endpoint well_known_endpoint; @@ -829,7 +829,7 @@ void report_crawls (Stream const& stream, CrawlSequence const& c) { if (! stream) return; - stream + stream << "Crawl Report" << std::endl << std::setw (6) << "Step" @@ -957,7 +957,7 @@ void report_node_timeline (Node const& node, Stream const& stream) field (sequence_to_string (t.begin (), t.end(), " ", 2), histw) << fpad (2) ; - } + } } //------------------------------------------------------------------------------ @@ -1038,7 +1038,7 @@ public: "Time " << n.now ().time_since_epoch () << std::endl << divider () ; - + n.step(); n.journal().info << std::endl; } diff --git a/src/ripple/peerfinder/sim/WrappedSink.h b/src/ripple/peerfinder/sim/WrappedSink.h index b4d7c45bd..96dd0a362 100644 --- a/src/ripple/peerfinder/sim/WrappedSink.h +++ b/src/ripple/peerfinder/sim/WrappedSink.h @@ -62,7 +62,7 @@ public: default: case Journal::kFatal: s += "Fatal: "; break; }; - + s+= text; m_sink.write (level, s); } diff --git a/src/ripple/resource/impl/LegacyFees.cpp b/src/ripple/resource/impl/LegacyFees.cpp index a9a630e09..68361fb6e 100644 --- a/src/ripple/resource/impl/LegacyFees.cpp +++ b/src/ripple/resource/impl/LegacyFees.cpp @@ -47,7 +47,7 @@ Charge legacyFee (LoadType t) case LT_NeededData: return feeSatisfiedRequest; case LT_RequestData: return feeRequestedData; - + default: bassertfalse; case LT_CheapQuery: return feeCheapQuery; diff --git a/src/ripple/rpc/handlers/AccountLines.cpp b/src/ripple/rpc/handlers/AccountLines.cpp index 3ab7511f4..fe528d0c7 100644 --- a/src/ripple/rpc/handlers/AccountLines.cpp +++ b/src/ripple/rpc/handlers/AccountLines.cpp @@ -136,7 +136,7 @@ Json::Value doAccountLines (RPC::Context& context) limit = RPC::Tuning::defaultLinesPerRequest; } - Json::Value& jsonLines (result[jss::lines] = Json::arrayValue); + Json::Value& jsonLines (result[jss::lines] = Json::arrayValue); Account const& raAccount(rippleAddress.getAccountID ()); VisitData visitData = { {}, raAccount, rippleAddressPeer, raPeerAccount }; unsigned int reserve (limit); @@ -146,7 +146,7 @@ Json::Value doAccountLines (RPC::Context& context) if (params.isMember (jss::marker)) { // We have a start point. Use limit - 1 from the result and use the - // very last one for the resume. + // very last one for the resume. Json::Value const& marker (params[jss::marker]); if (! marker.isString ()) @@ -157,7 +157,7 @@ Json::Value doAccountLines (RPC::Context& context) if (sleLine == nullptr || sleLine->getType () != ltRIPPLE_STATE) return rpcError (rpcINVALID_PARAMS); - + if (sleLine->getFieldAmount (sfLowLimit).getIssuer () == raAccount) startHint = sleLine->getFieldU64 (sfLowNode); else if (sleLine->getFieldAmount (sfHighLimit).getIssuer () == raAccount) @@ -197,7 +197,7 @@ Json::Value doAccountLines (RPC::Context& context) { return rpcError (rpcINVALID_PARAMS); } - + if (visitData.items.size () == reserve) { result[jss::limit] = limit; diff --git a/src/ripple/rpc/handlers/AccountOffers.cpp b/src/ripple/rpc/handlers/AccountOffers.cpp index 77105945e..ed75d3af3 100644 --- a/src/ripple/rpc/handlers/AccountOffers.cpp +++ b/src/ripple/rpc/handlers/AccountOffers.cpp @@ -74,9 +74,9 @@ Json::Value doAccountOffers (RPC::Context& context) { limit = RPC::Tuning::defaultOffersPerRequest; } - + Account const& raAccount (rippleAddress.getAccountID ()); - Json::Value& jsonOffers (result[jss::offers] = Json::arrayValue); + Json::Value& jsonOffers (result[jss::offers] = Json::arrayValue); std::vector offers; unsigned int reserve (limit); uint256 startAfter; @@ -85,7 +85,7 @@ Json::Value doAccountOffers (RPC::Context& context) if (params.isMember(jss::marker)) { // We have a start point. Use limit - 1 from the result and use the - // very last one for the resume. + // very last one for the resume. Json::Value const& marker (params[jss::marker]); if (! marker.isString ()) @@ -108,14 +108,14 @@ Json::Value doAccountOffers (RPC::Context& context) sleOffer->getFieldAmount (sfTakerPays).setJson (obj[jss::taker_pays]); sleOffer->getFieldAmount (sfTakerGets).setJson (obj[jss::taker_gets]); obj[jss::seq] = sleOffer->getFieldU32 (sfSequence); - obj[jss::flags] = sleOffer->getFieldU32 (sfFlags); + obj[jss::flags] = sleOffer->getFieldU32 (sfFlags); offers.reserve (reserve); } else { startHint = 0; - // We have no start point, limit should be one higher than requested. + // We have no start point, limit should be one higher than requested. offers.reserve (++reserve); } @@ -138,7 +138,7 @@ Json::Value doAccountOffers (RPC::Context& context) { result[jss::limit] = limit; - result[jss::marker] = to_string (offers.back ()->getIndex ()); + result[jss::marker] = to_string (offers.back ()->getIndex ()); offers.pop_back (); } @@ -148,7 +148,7 @@ Json::Value doAccountOffers (RPC::Context& context) offer->getFieldAmount (sfTakerPays).setJson (obj[jss::taker_pays]); offer->getFieldAmount (sfTakerGets).setJson (obj[jss::taker_gets]); obj[jss::seq] = offer->getFieldU32 (sfSequence); - obj[jss::flags] = offer->getFieldU32 (sfFlags); + obj[jss::flags] = offer->getFieldU32 (sfFlags); } context.loadType_ = Resource::feeMediumBurdenRPC; diff --git a/src/ripple/rpc/handlers/GetCounts.cpp b/src/ripple/rpc/handlers/GetCounts.cpp index 0523efa54..00d1b319a 100644 --- a/src/ripple/rpc/handlers/GetCounts.cpp +++ b/src/ripple/rpc/handlers/GetCounts.cpp @@ -85,7 +85,7 @@ Json::Value doGetCounts (RPC::Context& context) textTime (uptime, s, "minute", 60); textTime (uptime, s, "second", 1); ret["uptime"] = uptime; - + ret["node_writes"] = app.getNodeStore().getStoreCount(); ret["node_reads_total"] = app.getNodeStore().getFetchTotalCount(); ret["node_reads_hit"] = app.getNodeStore().getFetchHitCount(); diff --git a/src/ripple/rpc/impl/Tuning.h b/src/ripple/rpc/impl/Tuning.h index 40c0c5380..c55cc4191 100644 --- a/src/ripple/rpc/impl/Tuning.h +++ b/src/ripple/rpc/impl/Tuning.h @@ -66,7 +66,7 @@ int const maxRequestSize (1000000); } // Tuning /** @} */ - + } // RPC } // ripple diff --git a/src/ripple/sslutil/impl/ECDSACanonical.cpp b/src/ripple/sslutil/impl/ECDSACanonical.cpp index 48ac93484..fdbe5e77d 100644 --- a/src/ripple/sslutil/impl/ECDSACanonical.cpp +++ b/src/ripple/sslutil/impl/ECDSACanonical.cpp @@ -66,7 +66,7 @@ namespace detail { { return num; } - + operator BIGNUM const* () const { return num; @@ -94,9 +94,9 @@ namespace detail { // The format is: <02> if ((sig[0] != 0x02) || (size < 3)) return; - + size_t const len (sig[1]); - + // Claimed length can't be longer than amount of data available if (len > (size - 2)) return; @@ -133,7 +133,7 @@ namespace detail { { return m_bn; } - + // Returns the number of bytes to skip for this signature part size_t skip () const { @@ -148,11 +148,11 @@ namespace detail { /** Determine whether a signature is canonical. Canonical signatures are important to protect against signature morphing - attacks. + attacks. @param vSig the signature data @param sigLen the length of the signature @param strict_param whether to enforce strictly canonical semantics - + @note For more details please see: https://ripple.com/wiki/Transaction_Malleability https://bitcointalk.org/index.php?topic=8392.msg127623#msg127623 @@ -170,27 +170,27 @@ bool isCanonicalECDSASig (void const* vSig, size_t sigLen, ECDSA strict_param) if ((sig[0] != 0x30) || (sig[1] != (sigLen - 2))) return false; - + // The first two bytes are verified. Eat them. sig += 2; sigLen -= 2; // Verify the R signature detail::SignaturePart sigR (sig, sigLen); - + if (!sigR.valid ()) return false; // Eat the number of bytes we consumed sig += sigR.skip (); sigLen -= sigR.skip (); - + // Verify the S signature detail::SignaturePart sigS (sig, sigLen); - + if (!sigS.valid ()) return false; - + // Eat the number of bytes we consumed sig += sigS.skip (); sigLen -= sigS.skip (); @@ -207,7 +207,7 @@ bool isCanonicalECDSASig (void const* vSig, size_t sigLen, ECDSA strict_param) return false; if (BN_cmp (bnS, detail::modulus) != -1) - return false; + return false; // For a given signature, (R,S), the signature (R, N-S) is also valid. For // a signature to be fully-canonical, the smaller of these two values must @@ -228,7 +228,7 @@ bool isCanonicalECDSASig (void const* vSig, size_t sigLen, ECDSA strict_param) /** Convert a signature into strictly canonical form. Given the signature (R, S) then (R, G-S) is also valid. For a signature - to be canonical, the smaller of { S, G-S } must be specified. + to be canonical, the smaller of { S, G-S } must be specified. @param vSig the signature we wish to convert @param sigLen the length of the signature @returns true if the signature was already canonical, false otherwise @@ -340,12 +340,12 @@ public: "022100FF478110D1D4294471EC76E0157540C2181F47DEBD25D7F9E7DDCCCD47EEE905" "0220078F07CDAE6C240855D084AD91D1479609533C147C93B0AEF19BC9724D003F28"), "Strictly canonical signature"); - + expect (isStrictlyCanonical("3045" "0221009218248292F1762D8A51BE80F8A7F2CD288D810CE781D5955700DA1684DF1D2D" "022041A1EE1746BFD72C9760CC93A7AAA8047D52C8833A03A20EAAE92EA19717B454"), "Strictly canonical signature"); - + expect (isStrictlyCanonical("3044" "02206A9E43775F73B6D1EC420E4DDD222A80D4C6DF5D1BEECC431A91B63C928B7581" "022023E9CC2D61DDA6F73EAA6BCB12688BEB0F434769276B3127E4044ED895C9D96B"), @@ -389,8 +389,8 @@ public: testcase ("Canonical signature checks", abort_on_fail); // r and s 1 byte 1 - expect (isValid ("3006" - "020101" + expect (isValid ("3006" + "020101" "020102"), "Well-formed short signature"); @@ -413,12 +413,12 @@ public: "022100FF478110D1D4294471EC76E0157540C2181F47DEBD25D7F9E7DDCCCD47EEE905" "0220078F07CDAE6C240855D084AD91D1479609533C147C93B0AEF19BC9724D003F28"), "Canonical signature"); - + expect (isStrictlyCanonical("3045" "0221009218248292F1762D8A51BE80F8A7F2CD288D810CE781D5955700DA1684DF1D2D" "022041A1EE1746BFD72C9760CC93A7AAA8047D52C8833A03A20EAAE92EA19717B454"), "Canonical signature"); - + expect (isStrictlyCanonical("3044" "02206A9E43775F73B6D1EC420E4DDD222A80D4C6DF5D1BEECC431A91B63C928B7581" "022023E9CC2D61DDA6F73EAA6BCB12688BEB0F434769276B3127E4044ED895C9D96B"), @@ -445,38 +445,38 @@ public: "0200"), "tooshort"); - expect (!isValid ("3006" - "020101" + expect (!isValid ("3006" + "020101" "020202"), "Slen-Overlong"); - expect (!isValid ("3006" - "020701" + expect (!isValid ("3006" + "020701" "020102"), "Rlen-Overlong-OOB"); - expect (!isValid ("3006" - "020401" + expect (!isValid ("3006" + "020401" "020102"), "Rlen-Overlong-OOB"); - expect (!isValid ("3006" - "020501" + expect (!isValid ("3006" + "020501" "020102"), "Rlen-Overlong-OOB"); - expect (!isValid ("3006" - "020201" + expect (!isValid ("3006" + "020201" "020102"), "Rlen-Overlong"); - expect (!isValid ("3006" - "020301" + expect (!isValid ("3006" + "020301" "020202"), "Rlen Overlong and Slen-Overlong"); - expect (!isValid ("3006" - "020401" + expect (!isValid ("3006" + "020401" "020202"), "Rlen Overlong and OOB and Slen-Overlong"); @@ -554,7 +554,7 @@ public: size_t len = b.size (); - expect (!makeCanonicalECDSASig (&b[0], len), + expect (!makeCanonicalECDSASig (&b[0], len), "non-canonical signature was already canonical"); expect (b.size () >= len, @@ -602,7 +602,7 @@ public: "3045" "02210099DCA1188663DDEA506A06A7B20C2B7D8C26AFF41DECE69D6C5F7C967D32625F" "02207689A7594E06111A2EBF285CCD25F4277EF55371C4F4AA1BA4D09CD73B43BA57"); - + convertNonCanonical ( "3045" "02200855DE366E4E323AA2CE2A25674401A7D11F72EC432770D07F7B57DF7387AEC0" diff --git a/src/ripple/types/CryptoIdentifier.h b/src/ripple/types/CryptoIdentifier.h index caab5dbd9..4c70a8ecf 100644 --- a/src/ripple/types/CryptoIdentifier.h +++ b/src/ripple/types/CryptoIdentifier.h @@ -33,7 +33,7 @@ namespace ripple { @tparam Size The number of bytes in the identifier, exclusive of version, checksum, or padding. - + @tparam Token A byte prepended to the binary data that distinguishes the type of identifier. @@ -129,7 +129,7 @@ public: } }; -template +template typename CryptoIdentifier ::size_type const CryptoIdentifier ::size; } diff --git a/src/ripple/types/IdentifierStorage.h b/src/ripple/types/IdentifierStorage.h index b895b28c8..1d1f83e09 100644 --- a/src/ripple/types/IdentifierStorage.h +++ b/src/ripple/types/IdentifierStorage.h @@ -62,7 +62,7 @@ public: { return lhs == rhs; } - }; + }; // iterator access iterator begin() { return &m_storage[pre_size]; } diff --git a/src/ripple/types/impl/strHex.cpp b/src/ripple/types/impl/strHex.cpp index c1310c124..d0ceb1b2b 100644 --- a/src/ripple/types/impl/strHex.cpp +++ b/src/ripple/types/impl/strHex.cpp @@ -28,7 +28,7 @@ char charHex (int iDigit) if(iDigit < 16) return 'A' - 10 + iDigit; } - + return 0; } @@ -56,7 +56,7 @@ int charUnHex (char cDigit) }; static HexTab xtab; - + return xtab[cDigit]; } diff --git a/src/ripple/types/strHex.h b/src/ripple/types/strHex.h index 7288d1470..557be3c37 100644 --- a/src/ripple/types/strHex.h +++ b/src/ripple/types/strHex.h @@ -27,7 +27,7 @@ namespace ripple { -/** Converts an integer to the corresponding hex digit +/** Converts an integer to the corresponding hex digit @param iDigit 0-15 inclusive @return a character from '0'-'9' or 'A'-'F' on success; 0 on failure. */ diff --git a/src/ripple/validators/impl/SourceFile.cpp b/src/ripple/validators/impl/SourceFile.cpp index aa8d60af1..8774865b7 100644 --- a/src/ripple/validators/impl/SourceFile.cpp +++ b/src/ripple/validators/impl/SourceFile.cpp @@ -36,7 +36,7 @@ public: ~SourceFileImp () { } - + std::string to_string () const { std::stringstream ss; @@ -54,7 +54,7 @@ public: { return m_file.getFullPathName ().toStdString(); } - + void fetch (Results& results, beast::Journal journal) { std::int64_t const fileSize (m_file.getSize ()); diff --git a/src/ripple/validators/impl/Store.h b/src/ripple/validators/impl/Store.h index 453d1e0d0..f2f2fa5bb 100644 --- a/src/ripple/validators/impl/Store.h +++ b/src/ripple/validators/impl/Store.h @@ -36,7 +36,7 @@ public: information filled in from the Store. */ virtual void insert (SourceDesc& desc) = 0; - + /** Update the SourceDesc fixed fields. */ virtual void update (SourceDesc& desc, bool updateFetchResults = false) = 0; diff --git a/src/ripple/validators/impl/StoreSqdb.cpp b/src/ripple/validators/impl/StoreSqdb.cpp index e15cee537..8b3f56039 100644 --- a/src/ripple/validators/impl/StoreSqdb.cpp +++ b/src/ripple/validators/impl/StoreSqdb.cpp @@ -284,7 +284,7 @@ bool StoreSqdb::select (SourceDesc& desc) { m_journal.debug << "Found record for " << *desc.source; - + found = true; desc.lastFetchTime = stringToTime (lastFetchTime); desc.expirationTime = stringToTime (expirationTime); @@ -311,7 +311,7 @@ bool StoreSqdb::select (SourceDesc& desc) void StoreSqdb::selectList (SourceDesc& desc) { beast::Error error; - + std::string const sourceID (desc.source->uniqueID()); // Get the count