From df54b47cd0957a31837493cd69e4d9aade0b5055 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Mon, 29 Dec 2014 08:49:55 -0800 Subject: [PATCH] Tidy up includes and add modules to the classic build: An alternative to the unity build, the classic build compiles each translation unit individually. This adds more modules to the classic build: * Remove unity header app.h * Add missing includes as needed * Remove obsolete NodeStore backend code * Add app/, core/, crypto/, json/, net/, overlay/, peerfinder/ to classic build --- Builds/VisualStudio2013/RippleD.vcxproj | 17 +- .../VisualStudio2013/RippleD.vcxproj.filters | 21 +- SConstruct | 48 +- src/ripple/app/book/BookTip.h | 2 +- src/ripple/app/book/impl/BookTip.cpp | 1 + src/ripple/app/book/impl/OfferStream.cpp | 1 + src/ripple/app/book/impl/Quality.cpp | 2 +- src/ripple/app/book/impl/Taker.cpp | 1 + .../app/book/tests/OfferStream.test.cpp | 2 +- src/ripple/app/book/tests/Quality.test.cpp | 2 +- src/ripple/app/consensus/DisputedTx.cpp | 6 + src/ripple/app/consensus/LedgerConsensus.cpp | 1 + src/ripple/app/data/DBInit.cpp | 4 + src/ripple/app/data/Database.cpp | 4 + src/ripple/app/data/Database.h | 3 + src/ripple/app/data/DatabaseCon.cpp | 2 + src/ripple/app/data/DatabaseCon.h | 3 +- src/ripple/app/data/SqliteDatabase.cpp | 1 + src/ripple/app/data/SqliteDatabase.h | 4 + src/ripple/app/impl/BasicApp.cpp | 2 + src/ripple/app/ledger/AcceptedLedger.cpp | 2 + src/ripple/app/ledger/AcceptedLedger.h | 2 + src/ripple/app/ledger/AcceptedLedgerTx.cpp | 3 + src/ripple/app/ledger/AcceptedLedgerTx.h | 2 + src/ripple/app/ledger/AccountStateSF.cpp | 6 + src/ripple/app/ledger/BookListeners.cpp | 3 + src/ripple/app/ledger/BookListeners.h | 3 + src/ripple/app/ledger/ConsensusTransSetSF.cpp | 5 + .../app/ledger/DirectoryEntryIterator.cpp | 4 + .../app/ledger/DirectoryEntryIterator.h | 4 + src/ripple/app/ledger/InboundLedger.cpp | 6 + src/ripple/app/ledger/InboundLedger.h | 2 + src/ripple/app/ledger/InboundLedgers.cpp | 3 + src/ripple/app/ledger/Ledger.cpp | 14 + src/ripple/app/ledger/Ledger.test.cpp | 5 + src/ripple/app/ledger/LedgerCleaner.cpp | 7 + src/ripple/app/ledger/LedgerCleaner.h | 3 +- src/ripple/app/ledger/LedgerEntrySet.cpp | 4 + src/ripple/app/ledger/LedgerEntrySet.h | 6 + src/ripple/app/ledger/LedgerHistory.cpp | 4 +- src/ripple/app/ledger/LedgerHistory.h | 4 +- src/ripple/app/ledger/LedgerMaster.cpp | 19 +- src/ripple/app/ledger/LedgerMaster.h | 1 + src/ripple/app/ledger/LedgerProposal.cpp | 4 +- src/ripple/app/ledger/LedgerProposal.h | 12 +- src/ripple/app/ledger/LedgerTiming.cpp | 1 + src/ripple/app/ledger/OrderBookDB.cpp | 9 + src/ripple/app/ledger/OrderBookIterator.cpp | 4 + src/ripple/app/ledger/OrderBookIterator.h | 5 + src/ripple/app/ledger/TransactionStateSF.cpp | 6 + src/ripple/app/main/Application.cpp | 22 + src/ripple/app/main/CollectorManager.cpp | 1 + src/ripple/app/main/LoadManager.cpp | 10 +- src/ripple/app/main/LocalCredentials.cpp | 9 +- src/ripple/app/main/LocalCredentials.h | 6 +- src/ripple/app/main/Main.cpp | 62 + src/ripple/app/main/NodeStoreScheduler.cpp | 1 + src/ripple/app/main/ParameterTable.cpp | 198 ---- src/ripple/app/main/ParameterTable.h | 103 -- src/ripple/app/misc/AccountState.cpp | 6 + src/ripple/app/misc/AccountState.h | 7 +- src/ripple/app/misc/AmendmentTableImpl.cpp | 11 +- src/ripple/app/misc/CanonicalTXSet.cpp | 3 + src/ripple/app/misc/CanonicalTXSet.h | 3 +- .../app/misc/DefaultMissingNodeHandler.cpp | 2 + src/ripple/app/misc/FeeVote.h | 1 + src/ripple/app/misc/FeeVoteImpl.cpp | 7 + src/ripple/app/misc/HashRouter.cpp | 10 +- src/ripple/app/misc/IHashRouter.h | 1 + src/ripple/app/misc/NetworkOPs.cpp | 23 +- src/ripple/app/misc/NetworkOPs.h | 2 + src/ripple/app/misc/SHAMapStore.h | 3 + src/ripple/app/misc/SHAMapStoreImp.cpp | 8 +- src/ripple/app/misc/SHAMapStoreImp.h | 1 + src/ripple/app/misc/Validations.cpp | 9 + src/ripple/app/node/SqliteFactory.cpp | 4 + src/ripple/app/paths/AccountCurrencies.cpp | 1 + src/ripple/app/paths/AccountCurrencies.h | 2 + src/ripple/app/paths/Credit.cpp | 5 +- src/ripple/app/paths/Credit.h | 3 + src/ripple/app/paths/FindPaths.cpp | 1 + src/ripple/app/paths/FindPaths.h | 2 + src/ripple/app/paths/Node.cpp | 4 + src/ripple/app/paths/NodeDirectory.h | 5 + src/ripple/app/paths/PathRequest.cpp | 6 + src/ripple/app/paths/PathRequest.h | 1 + src/ripple/app/paths/PathRequests.cpp | 3 + src/ripple/app/paths/PathState.cpp | 5 + src/ripple/app/paths/PathState.h | 1 + src/ripple/app/paths/Pathfinder.cpp | 6 + src/ripple/app/paths/Pathfinder.h | 6 + src/ripple/app/paths/RippleCalc.cpp | 2 + src/ripple/app/paths/RippleCalc.h | 5 + src/ripple/app/paths/RippleLineCache.cpp | 3 + src/ripple/app/paths/RippleState.cpp | 8 + src/ripple/app/paths/RippleState.h | 5 + src/ripple/app/paths/cursor/AdvanceNode.cpp | 2 + .../app/paths/cursor/DeliverNodeForward.cpp | 2 + .../app/paths/cursor/DeliverNodeReverse.cpp | 2 + .../app/paths/cursor/ForwardLiquidity.cpp | 3 + .../cursor/ForwardLiquidityForAccount.cpp | 2 + src/ripple/app/paths/cursor/Liquidity.cpp | 10 +- src/ripple/app/paths/cursor/NextIncrement.cpp | 12 +- src/ripple/app/paths/cursor/PathCursor.h | 2 + .../app/paths/cursor/ReverseLiquidity.cpp | 3 + .../cursor/ReverseLiquidityForAccount.cpp | 5 +- .../app/paths/cursor/RippleLiquidity.cpp | 3 + src/ripple/app/peers/PeerSet.cpp | 4 + src/ripple/app/peers/PeerSet.h | 5 + src/ripple/app/peers/UniqueNodeList.cpp | 10 + src/ripple/app/transactors/AddWallet.cpp | 6 + src/ripple/app/transactors/CancelOffer.cpp | 6 + src/ripple/app/transactors/CancelTicket.cpp | 5 + src/ripple/app/transactors/Change.cpp | 16 +- src/ripple/app/transactors/CreateOffer.cpp | 1024 ++++++++--------- src/ripple/app/transactors/CreateOffer.h | 83 ++ .../app/transactors/CreateOfferBridged.cpp | 2 + .../app/transactors/CreateOfferDirect.cpp | 2 + src/ripple/app/transactors/CreateTicket.cpp | 5 + src/ripple/app/transactors/Payment.cpp | 6 + src/ripple/app/transactors/SetAccount.cpp | 6 + src/ripple/app/transactors/SetRegularKey.cpp | 5 + src/ripple/app/transactors/SetTrust.cpp | 7 + src/ripple/app/transactors/Transactor.cpp | 2 + src/ripple/app/transactors/Transactor.h | 2 + src/ripple/app/tx/LocalTxs.cpp | 5 +- src/ripple/app/tx/Transaction.cpp | 7 + src/ripple/app/tx/TransactionAcquire.cpp | 6 + src/ripple/app/tx/TransactionAcquire.h | 1 + src/ripple/app/tx/TransactionCheck.cpp | 3 + src/ripple/app/tx/TransactionEngine.cpp | 9 + src/ripple/app/tx/TransactionMaster.cpp | 4 + src/ripple/app/tx/TransactionMaster.h | 6 +- src/ripple/app/tx/TransactionMeta.cpp | 5 + src/ripple/app/websocket/WSConnection.cpp | 3 + src/ripple/app/websocket/WSConnection.h | 3 + src/ripple/app/websocket/WSDoor.cpp | 9 +- src/ripple/app/websocket/WSDoor.h | 3 + src/ripple/app/websocket/WSServerHandler.cpp | 1 + src/ripple/app/websocket/WSServerHandler.h | 7 +- src/ripple/basics/TestSuite.h | 1 + src/ripple/basics/impl/BasicConfig.cpp | 1 + .../basics/impl/CheckLibraryVersions.cpp | 9 +- src/ripple/basics/impl/CountedObject.cpp | 1 + src/ripple/basics/impl/Log.cpp | 1 + src/ripple/basics/impl/RangeSet.cpp | 1 + src/ripple/basics/impl/ResolverAsio.cpp | 1 + src/ripple/basics/impl/StringUtilities.cpp | 1 + src/ripple/basics/impl/Sustain.cpp | 1 + src/ripple/basics/impl/TestSuite.test.cpp | 1 + src/ripple/basics/impl/ThreadName.cpp | 2 + src/ripple/basics/impl/Time.cpp | 1 + src/ripple/basics/impl/UptimeTimer.cpp | 1 + src/ripple/basics/impl/make_SSLContext.cpp | 1 + src/ripple/basics/impl/strHex.cpp | 1 + .../tests/CheckLibraryVersions.test.cpp | 1 + src/ripple/basics/tests/KeyCache.test.cpp | 2 +- src/ripple/basics/tests/RangeSet.test.cpp | 1 + .../basics/tests/StringUtilities.test.cpp | 1 + src/ripple/basics/tests/TaggedCache.test.cpp | 2 +- src/ripple/core/JobQueue.h | 1 + src/ripple/core/impl/Config.cpp | 1 + src/ripple/core/impl/Job.cpp | 1 + src/ripple/core/impl/JobQueue.cpp | 3 +- src/ripple/core/impl/LoadEvent.cpp | 1 + src/ripple/core/impl/LoadFeeTrackImp.cpp | 1 + src/ripple/core/impl/LoadMonitor.cpp | 1 + src/ripple/core/tests/LoadFeeTrack.test.cpp | 2 + src/ripple/crypto/ECDSACanonical.h | 11 +- src/ripple/crypto/impl/Base58.cpp | 2 +- src/ripple/crypto/impl/Base58Data.cpp | 1 + src/ripple/crypto/impl/CBigNum.cpp | 2 +- src/ripple/crypto/impl/DHUtil.cpp | 1 + src/ripple/crypto/impl/ECDSA.cpp | 1 + src/ripple/crypto/impl/ECDSACanonical.cpp | 26 +- src/ripple/crypto/impl/ECIES.cpp | 2 + .../crypto/impl/GenerateDeterministicKey.cpp | 4 + src/ripple/crypto/impl/RFC1751.cpp | 1 + src/ripple/crypto/impl/RandomNumbers.cpp | 3 +- src/ripple/crypto/impl/ec_key.cpp | 1 + src/ripple/crypto/tests/CKey.test.cpp | 1 + .../crypto/tests/ECDSACanonical.test.cpp | 1 + src/ripple/json/JsonPropertyStream.h | 1 + src/ripple/json/impl/JsonPropertyStream.cpp | 2 + src/ripple/json/impl/json_assert.h | 27 + src/ripple/json/impl/json_reader.cpp | 2 + src/ripple/json/impl/json_value.cpp | 4 +- src/ripple/json/impl/json_writer.cpp | 5 + src/ripple/json/impl/to_string.cpp | 2 + src/ripple/json/json_features.h | 2 + src/ripple/json/json_forwards.h | 2 + src/ripple/json/json_writer.h | 5 + src/ripple/json/tests/JsonCpp.test.cpp | 3 + src/ripple/json/to_string.h | 7 +- src/ripple/net/InfoSub.h | 1 + src/ripple/net/RPCCall.h | 6 + src/ripple/net/RPCErr.h | 2 + src/ripple/net/RPCSub.h | 3 + src/ripple/net/impl/HTTPClient.cpp | 2 + src/ripple/net/impl/HTTPRequest.cpp | 1 + src/ripple/net/impl/InfoSub.cpp | 1 + src/ripple/net/impl/RPCCall.cpp | 17 +- src/ripple/net/impl/RPCErr.cpp | 4 + src/ripple/net/impl/RPCSub.cpp | 7 +- src/ripple/net/impl/SNTPClient.cpp | 7 +- .../nodestore/backend/HyperDBFactory.cpp | 4 + .../nodestore/backend/LevelDBFactory.cpp | 13 +- .../nodestore/backend/MemoryFactory.cpp | 2 + src/ripple/nodestore/backend/NullFactory.cpp | 1 + .../nodestore/backend/RocksDBFactory.cpp | 12 +- .../nodestore/backend/RocksDBQuickFactory.cpp | 4 + src/ripple/nodestore/impl/BatchWriter.cpp | 1 + .../nodestore/impl/DatabaseRotatingImp.cpp | 1 + src/ripple/nodestore/impl/DecodedBlob.cpp | 1 + src/ripple/nodestore/impl/DummyScheduler.cpp | 1 + src/ripple/nodestore/impl/EncodedBlob.cpp | 1 + src/ripple/nodestore/impl/ManagerImp.cpp | 1 + src/ripple/nodestore/impl/NodeObject.cpp | 1 + src/ripple/nodestore/tests/Backend.test.cpp | 1 + src/ripple/nodestore/tests/Basics.test.cpp | 1 + src/ripple/nodestore/tests/Database.test.cpp | 1 + src/ripple/nodestore/tests/Timing.test.cpp | 2 + src/ripple/overlay/impl/ConnectAttempt.cpp | 2 + src/ripple/overlay/impl/Message.cpp | 2 +- src/ripple/overlay/impl/OverlayImpl.cpp | 1 + src/ripple/overlay/impl/PeerImp.cpp | 14 +- src/ripple/overlay/impl/PeerImp.h | 14 +- src/ripple/overlay/impl/TMHello.cpp | 4 + src/ripple/overlay/impl/TMHello.h | 6 +- src/ripple/overlay/tests/TMHello.test.cpp | 1 + src/ripple/overlay/tests/short_read.test.cpp | 1 + src/ripple/peerfinder/impl/Bootcache.cpp | 1 + src/ripple/peerfinder/impl/Counts.h | 1 + src/ripple/peerfinder/impl/Endpoint.cpp | 1 + src/ripple/peerfinder/impl/Livecache.h | 2 + src/ripple/peerfinder/impl/Logic.h | 2 + src/ripple/peerfinder/impl/Manager.cpp | 1 + .../impl/{Config.cpp => PeerfinderConfig.cpp} | 2 + src/ripple/peerfinder/impl/SlotImp.cpp | 3 + src/ripple/peerfinder/impl/SlotImp.h | 1 + src/ripple/peerfinder/impl/Source.h | 1 + src/ripple/peerfinder/impl/SourceStrings.cpp | 3 + src/ripple/peerfinder/impl/SourceStrings.h | 3 + src/ripple/peerfinder/sim/Tests.cpp | 2 + .../peerfinder/tests/Livecache.test.cpp | 1 + src/ripple/protocol/ErrorCodes.h | 2 + src/ripple/protocol/Indexes.h | 1 + src/ripple/protocol/STParsedJSON.h | 2 + src/ripple/protocol/impl/BuildInfo.cpp | 1 + src/ripple/protocol/impl/ByteOrder.cpp | 7 +- src/ripple/protocol/impl/ErrorCodes.cpp | 1 + src/ripple/protocol/impl/HashPrefix.cpp | 1 + src/ripple/protocol/impl/Indexes.cpp | 1 + src/ripple/protocol/impl/LedgerFormats.cpp | 1 + src/ripple/protocol/impl/RippleAddress.cpp | 1 + src/ripple/protocol/impl/SField.cpp | 1 + src/ripple/protocol/impl/SOTemplate.cpp | 1 + src/ripple/protocol/impl/STAccount.cpp | 1 + src/ripple/protocol/impl/STAmount.cpp | 1 + src/ripple/protocol/impl/STArray.cpp | 1 + src/ripple/protocol/impl/STBase.cpp | 1 + src/ripple/protocol/impl/STBlob.cpp | 1 + src/ripple/protocol/impl/STInteger.cpp | 1 + src/ripple/protocol/impl/STLedgerEntry.cpp | 1 + src/ripple/protocol/impl/STObject.cpp | 1 + src/ripple/protocol/impl/STParsedJSON.cpp | 1 + src/ripple/protocol/impl/STPathSet.cpp | 2 + src/ripple/protocol/impl/STTx.cpp | 1 + src/ripple/protocol/impl/STValidation.cpp | 3 +- src/ripple/protocol/impl/STVector256.cpp | 1 + src/ripple/protocol/impl/Serializer.cpp | 1 + src/ripple/protocol/impl/TER.cpp | 1 + src/ripple/protocol/impl/TxFormats.cpp | 1 + src/ripple/protocol/impl/UintTypes.cpp | 1 + src/ripple/protocol/tests/BuildInfo.test.cpp | 1 + src/ripple/protocol/tests/Issue.test.cpp | 1 + .../protocol/tests/RippleAddress.test.cpp | 1 + src/ripple/protocol/tests/STAmount.test.cpp | 1 + src/ripple/protocol/tests/STObject.test.cpp | 1 + src/ripple/protocol/tests/STTx.test.cpp | 1 + src/ripple/protocol/tests/Serializer.test.cpp | 1 + src/ripple/resource/impl/Charge.cpp | 1 + src/ripple/resource/impl/Consumer.cpp | 1 + src/ripple/resource/impl/Fees.cpp | 1 + src/ripple/resource/impl/Manager.cpp | 1 + src/ripple/resource/tests/Logic.test.cpp | 1 + src/ripple/rpc/handlers/AccountCurrencies.cpp | 2 + src/ripple/rpc/handlers/AccountInfo.cpp | 2 + src/ripple/rpc/handlers/AccountLines.cpp | 2 + src/ripple/rpc/handlers/AccountOffers.cpp | 1 + src/ripple/rpc/handlers/AccountTx.cpp | 1 + src/ripple/rpc/handlers/AccountTxOld.cpp | 1 + src/ripple/rpc/handlers/AccountTxSwitch.cpp | 2 + src/ripple/rpc/handlers/BlackList.cpp | 1 + src/ripple/rpc/handlers/BookOffers.cpp | 2 + src/ripple/rpc/handlers/CanDelete.cpp | 1 + src/ripple/rpc/handlers/Connect.cpp | 1 + src/ripple/rpc/handlers/ConsensusInfo.cpp | 2 + src/ripple/rpc/handlers/Feature.cpp | 2 + src/ripple/rpc/handlers/FetchInfo.cpp | 1 + src/ripple/rpc/handlers/GetCounts.cpp | 4 + src/ripple/rpc/handlers/Internal.cpp | 1 + src/ripple/rpc/handlers/Ledger.cpp | 1 + src/ripple/rpc/handlers/LedgerAccept.cpp | 1 + src/ripple/rpc/handlers/LedgerCleaner.cpp | 1 + src/ripple/rpc/handlers/LedgerClosed.cpp | 1 + src/ripple/rpc/handlers/LedgerCurrent.cpp | 1 + src/ripple/rpc/handlers/LedgerData.cpp | 1 + src/ripple/rpc/handlers/LedgerEntry.cpp | 2 + src/ripple/rpc/handlers/LedgerHeader.cpp | 1 + src/ripple/rpc/handlers/LedgerRequest.cpp | 2 + src/ripple/rpc/handlers/LogLevel.cpp | 1 + src/ripple/rpc/handlers/LogRotate.cpp | 1 + src/ripple/rpc/handlers/OwnerInfo.cpp | 1 + src/ripple/rpc/handlers/PathFind.cpp | 2 + src/ripple/rpc/handlers/Peers.cpp | 2 + src/ripple/rpc/handlers/Ping.cpp | 1 + src/ripple/rpc/handlers/Print.cpp | 1 + src/ripple/rpc/handlers/Random.cpp | 1 + src/ripple/rpc/handlers/RipplePathFind.cpp | 2 + src/ripple/rpc/handlers/SMS.cpp | 1 + src/ripple/rpc/handlers/ServerInfo.cpp | 1 + src/ripple/rpc/handlers/ServerState.cpp | 1 + src/ripple/rpc/handlers/Sign.cpp | 1 + src/ripple/rpc/handlers/Stop.cpp | 1 + src/ripple/rpc/handlers/Submit.cpp | 1 + src/ripple/rpc/handlers/Subscribe.cpp | 1 + src/ripple/rpc/handlers/TransactionEntry.cpp | 1 + src/ripple/rpc/handlers/Tx.cpp | 3 + src/ripple/rpc/handlers/TxHistory.cpp | 1 + src/ripple/rpc/handlers/UnlAdd.cpp | 2 + src/ripple/rpc/handlers/UnlDelete.cpp | 1 + src/ripple/rpc/handlers/UnlList.cpp | 1 + src/ripple/rpc/handlers/UnlLoad.cpp | 1 + src/ripple/rpc/handlers/UnlNetwork.cpp | 1 + src/ripple/rpc/handlers/UnlReset.cpp | 1 + src/ripple/rpc/handlers/UnlScore.cpp | 1 + src/ripple/rpc/handlers/Unsubscribe.cpp | 1 + src/ripple/rpc/handlers/ValidationCreate.cpp | 1 + src/ripple/rpc/handlers/ValidationSeed.cpp | 1 + src/ripple/rpc/handlers/WalletAccounts.cpp | 1 + src/ripple/rpc/handlers/WalletPropose.cpp | 1 + src/ripple/rpc/handlers/WalletSeed.cpp | 2 + src/ripple/rpc/impl/AccountFromString.cpp | 1 + src/ripple/rpc/impl/Accounts.cpp | 1 + src/ripple/rpc/impl/Context.h | 4 + src/ripple/rpc/impl/Coroutine.cpp | 1 + src/ripple/rpc/impl/DoPrint.h | 1 + src/ripple/rpc/impl/GetMasterGenerator.cpp | 1 + src/ripple/rpc/impl/Handler.cpp | 1 + src/ripple/rpc/impl/JsonObject.cpp | 1 + src/ripple/rpc/impl/JsonWriter.cpp | 1 + src/ripple/rpc/impl/LegacyPathFind.cpp | 1 + src/ripple/rpc/impl/LookupLedger.cpp | 1 + src/ripple/rpc/impl/Manager.cpp | 4 +- src/ripple/rpc/impl/ParseAccountIds.cpp | 1 + src/ripple/rpc/impl/RPCHandler.cpp | 16 +- src/ripple/rpc/impl/Status.cpp | 1 + src/ripple/rpc/impl/TransactionSign.cpp | 1 + src/ripple/rpc/impl/WriteJson.cpp | 1 + src/ripple/rpc/impl/Yield.cpp | 1 + src/ripple/rpc/tests/Coroutine.test.cpp | 1 + src/ripple/rpc/tests/JSONRPC.test.cpp | 1 + src/ripple/rpc/tests/JsonObject.test.cpp | 1 + src/ripple/rpc/tests/JsonWriter.test.cpp | 2 +- src/ripple/rpc/tests/Status.test.cpp | 1 + src/ripple/rpc/tests/WriteJson.test.cpp | 1 + src/ripple/rpc/tests/Yield.test.cpp | 1 + src/ripple/server/impl/Door.cpp | 1 + src/ripple/server/impl/JSONRPCUtil.cpp | 1 + src/ripple/server/impl/Role.cpp | 1 + src/ripple/server/impl/ServerHandlerImp.cpp | 1 + src/ripple/server/impl/ServerImpl.cpp | 1 + src/ripple/server/tests/Server.test.cpp | 1 + src/ripple/shamap/impl/SHAMap.cpp | 1 + src/ripple/shamap/impl/SHAMapDelta.cpp | 1 + src/ripple/shamap/impl/SHAMapItem.cpp | 1 + src/ripple/shamap/impl/SHAMapMissingNode.cpp | 1 + src/ripple/shamap/impl/SHAMapNodeID.cpp | 1 + src/ripple/shamap/impl/SHAMapSync.cpp | 1 + src/ripple/shamap/impl/SHAMapTreeNode.cpp | 1 + src/ripple/shamap/tests/FetchPack.test.cpp | 1 + src/ripple/shamap/tests/SHAMap.test.cpp | 1 + src/ripple/shamap/tests/SHAMapSync.test.cpp | 1 + src/ripple/unity/app.cpp | 65 -- src/ripple/unity/app.h | 91 -- src/ripple/unity/app2.cpp | 2 - src/ripple/unity/app3.cpp | 2 - src/ripple/unity/app4.cpp | 2 - src/ripple/unity/app5.cpp | 2 - src/ripple/unity/app6.cpp | 2 - src/ripple/unity/app7.cpp | 2 - src/ripple/unity/app8.cpp | 3 - src/ripple/unity/app9.cpp | 2 - src/ripple/unity/basics.cpp | 8 +- src/ripple/unity/crypto.cpp | 8 +- src/ripple/unity/net.cpp | 7 - src/ripple/unity/nodestore.cpp | 8 +- src/ripple/unity/overlay.cpp | 7 +- src/ripple/unity/peerfinder.cpp | 10 +- src/ripple/unity/protocol.cpp | 8 +- src/ripple/unity/resource.cpp | 9 +- src/ripple/unity/rpcx.cpp | 5 +- src/ripple/unity/shamap.cpp | 2 - src/ripple/unity/validators.cpp | 2 - src/ripple/validators/impl/ConnectionImp.cpp | 4 +- src/ripple/validators/impl/Logic.cpp | 1 + src/ripple/validators/impl/Manager.cpp | 1 + src/ripple/validators/impl/StoreSqdb.cpp | 1 + .../validators/tests/Validators.test.cpp | 1 + .../websocket/autosocket/AutoSocket.cpp | 2 + .../websocket/autosocket/LogWebsockets.cpp | 2 + 412 files changed, 1736 insertions(+), 1224 deletions(-) delete mode 100644 src/ripple/app/main/ParameterTable.cpp delete mode 100644 src/ripple/app/main/ParameterTable.h create mode 100644 src/ripple/app/transactors/CreateOffer.h create mode 100644 src/ripple/json/impl/json_assert.h rename src/ripple/peerfinder/impl/{Config.cpp => PeerfinderConfig.cpp} (96%) delete mode 100644 src/ripple/unity/app.h diff --git a/Builds/VisualStudio2013/RippleD.vcxproj b/Builds/VisualStudio2013/RippleD.vcxproj index 04b96c565..cfd9a38ac 100644 --- a/Builds/VisualStudio2013/RippleD.vcxproj +++ b/Builds/VisualStudio2013/RippleD.vcxproj @@ -1804,11 +1804,6 @@ - - True - - - @@ -1987,6 +1982,8 @@ True + + True @@ -2289,6 +2286,8 @@ True + + @@ -2504,9 +2503,6 @@ - - True - @@ -2525,6 +2521,9 @@ True + + True + @@ -3198,8 +3197,6 @@ - - diff --git a/Builds/VisualStudio2013/RippleD.vcxproj.filters b/Builds/VisualStudio2013/RippleD.vcxproj.filters index f189a8a69..4683f393b 100644 --- a/Builds/VisualStudio2013/RippleD.vcxproj.filters +++ b/Builds/VisualStudio2013/RippleD.vcxproj.filters @@ -2685,12 +2685,6 @@ ripple\app\main - - ripple\app\main - - - ripple\app\main - ripple\app\main @@ -2901,6 +2895,9 @@ ripple\app\transactors + + ripple\app\transactors + ripple\app\transactors @@ -3267,6 +3264,9 @@ ripple\json\impl + + ripple\json\impl + ripple\json\impl @@ -3534,9 +3534,6 @@ ripple\peerfinder\impl - - ripple\peerfinder\impl - ripple\peerfinder\impl @@ -3561,6 +3558,9 @@ ripple\peerfinder\impl + + ripple\peerfinder\impl + ripple\peerfinder\impl @@ -4347,9 +4347,6 @@ ripple\unity - - ripple\unity - ripple\unity diff --git a/SConstruct b/SConstruct index b5d46701a..de59a8100 100644 --- a/SConstruct +++ b/SConstruct @@ -546,7 +546,7 @@ def list_sources(base, suffixes): for path in files: path = os.path.join(parent, path) r = os.path.splitext(path) - if r[1] in suffixes: + if r[1] and r[1] in suffixes: yield os.path.normpath(path) return list(_iter(base)) @@ -576,8 +576,22 @@ for tu_style in ['classic', 'unity']: object_builder = ObjectBuilder(env, variant_dirs) if tu_style == 'classic': + object_builder.add_source_files( + *list_sources('src/ripple/app', '.cpp')) object_builder.add_source_files( *list_sources('src/ripple/basics', '.cpp')) + object_builder.add_source_files( + *list_sources('src/ripple/core', '.cpp')) + object_builder.add_source_files( + *list_sources('src/ripple/crypto', '.cpp')) + object_builder.add_source_files( + *list_sources('src/ripple/json', '.cpp')) + object_builder.add_source_files( + *list_sources('src/ripple/net', '.cpp')) + object_builder.add_source_files( + *list_sources('src/ripple/overlay', '.cpp')) + object_builder.add_source_files( + *list_sources('src/ripple/peerfinder', '.cpp')) object_builder.add_source_files( *list_sources('src/ripple/protocol', '.cpp')) object_builder.add_source_files( @@ -591,7 +605,23 @@ for tu_style in ['classic', 'unity']: ]) else: object_builder.add_source_files( + 'src/ripple/unity/app.cpp', + 'src/ripple/unity/app1.cpp', + 'src/ripple/unity/app2.cpp', + 'src/ripple/unity/app3.cpp', + 'src/ripple/unity/app4.cpp', + 'src/ripple/unity/app5.cpp', + 'src/ripple/unity/app6.cpp', + 'src/ripple/unity/app7.cpp', + 'src/ripple/unity/app8.cpp', + 'src/ripple/unity/app9.cpp', + 'src/ripple/unity/core.cpp', 'src/ripple/unity/basics.cpp', + 'src/ripple/unity/crypto.cpp', + 'src/ripple/unity/net.cpp', + 'src/ripple/unity/overlay.cpp', + 'src/ripple/unity/peerfinder.cpp', + 'src/ripple/unity/json.cpp', 'src/ripple/unity/protocol.cpp', 'src/ripple/unity/shamap.cpp', ) @@ -604,23 +634,7 @@ for tu_style in ['classic', 'unity']: ]) object_builder.add_source_files( - 'src/ripple/unity/app.cpp', - 'src/ripple/unity/app1.cpp', - 'src/ripple/unity/app2.cpp', - 'src/ripple/unity/app3.cpp', - 'src/ripple/unity/app4.cpp', - 'src/ripple/unity/app5.cpp', - 'src/ripple/unity/app6.cpp', - 'src/ripple/unity/app7.cpp', - 'src/ripple/unity/app8.cpp', - 'src/ripple/unity/app9.cpp', 'src/ripple/unity/beast.cpp', - 'src/ripple/unity/core.cpp', - 'src/ripple/unity/crypto.cpp', - 'src/ripple/unity/json.cpp', - 'src/ripple/unity/net.cpp', - 'src/ripple/unity/overlay.cpp', - 'src/ripple/unity/peerfinder.cpp', 'src/ripple/unity/protobuf.cpp', 'src/ripple/unity/ripple.proto.cpp', 'src/ripple/unity/resource.cpp', diff --git a/src/ripple/app/book/BookTip.h b/src/ripple/app/book/BookTip.h index 0059908fb..af949b010 100644 --- a/src/ripple/app/book/BookTip.h +++ b/src/ripple/app/book/BookTip.h @@ -22,7 +22,7 @@ #include #include - +#include #include #include diff --git a/src/ripple/app/book/impl/BookTip.cpp b/src/ripple/app/book/impl/BookTip.cpp index 8afbefaf7..6750d3f1f 100644 --- a/src/ripple/app/book/impl/BookTip.cpp +++ b/src/ripple/app/book/impl/BookTip.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/app/book/impl/OfferStream.cpp b/src/ripple/app/book/impl/OfferStream.cpp index db324fb1f..a905ae1cd 100644 --- a/src/ripple/app/book/impl/OfferStream.cpp +++ b/src/ripple/app/book/impl/OfferStream.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/app/book/impl/Quality.cpp b/src/ripple/app/book/impl/Quality.cpp index c418f09a4..8a1f9bde0 100644 --- a/src/ripple/app/book/impl/Quality.cpp +++ b/src/ripple/app/book/impl/Quality.cpp @@ -17,8 +17,8 @@ */ //============================================================================== +#include #include - #include #include diff --git a/src/ripple/app/book/impl/Taker.cpp b/src/ripple/app/book/impl/Taker.cpp index 9b510af4e..c1abc1bc5 100644 --- a/src/ripple/app/book/impl/Taker.cpp +++ b/src/ripple/app/book/impl/Taker.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/app/book/tests/OfferStream.test.cpp b/src/ripple/app/book/tests/OfferStream.test.cpp index 431e56934..1884c9eb0 100644 --- a/src/ripple/app/book/tests/OfferStream.test.cpp +++ b/src/ripple/app/book/tests/OfferStream.test.cpp @@ -17,8 +17,8 @@ */ //============================================================================== +#include #include - #include namespace ripple { diff --git a/src/ripple/app/book/tests/Quality.test.cpp b/src/ripple/app/book/tests/Quality.test.cpp index fd8f305c3..e4606d66f 100644 --- a/src/ripple/app/book/tests/Quality.test.cpp +++ b/src/ripple/app/book/tests/Quality.test.cpp @@ -17,8 +17,8 @@ */ //============================================================================== +#include #include - #include #include diff --git a/src/ripple/app/consensus/DisputedTx.cpp b/src/ripple/app/consensus/DisputedTx.cpp index 6ed67f616..f1f64c302 100644 --- a/src/ripple/app/consensus/DisputedTx.cpp +++ b/src/ripple/app/consensus/DisputedTx.cpp @@ -17,6 +17,12 @@ */ //============================================================================== +#include +#include +#include +#include +#include + namespace ripple { // Track a peer's yes/no vote on a particular disputed transaction diff --git a/src/ripple/app/consensus/LedgerConsensus.cpp b/src/ripple/app/consensus/LedgerConsensus.cpp index 231edd4d7..7f431453f 100644 --- a/src/ripple/app/consensus/LedgerConsensus.cpp +++ b/src/ripple/app/consensus/LedgerConsensus.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include // VFALCO bad dependency diff --git a/src/ripple/app/data/DBInit.cpp b/src/ripple/app/data/DBInit.cpp index 772f89e37..d611a6afc 100644 --- a/src/ripple/app/data/DBInit.cpp +++ b/src/ripple/app/data/DBInit.cpp @@ -17,6 +17,10 @@ */ //============================================================================== +#include +#include +#include + namespace ripple { // Transaction database holds transactions and public keys diff --git a/src/ripple/app/data/Database.cpp b/src/ripple/app/data/Database.cpp index b97b3d89b..ee3a9f3b1 100644 --- a/src/ripple/app/data/Database.cpp +++ b/src/ripple/app/data/Database.cpp @@ -17,6 +17,10 @@ */ //============================================================================== +#include +#include +#include + namespace ripple { Database::Database (const char* host) diff --git a/src/ripple/app/data/Database.h b/src/ripple/app/data/Database.h index 78071626d..d605c2f13 100644 --- a/src/ripple/app/data/Database.h +++ b/src/ripple/app/data/Database.h @@ -21,6 +21,9 @@ #define RIPPLE_DATABASE_H_INCLUDED #include +#include +#include +#include namespace ripple { diff --git a/src/ripple/app/data/DatabaseCon.cpp b/src/ripple/app/data/DatabaseCon.cpp index 95f1bf0f7..b13ad9443 100644 --- a/src/ripple/app/data/DatabaseCon.cpp +++ b/src/ripple/app/data/DatabaseCon.cpp @@ -17,7 +17,9 @@ */ //============================================================================== +#include #include +#include namespace ripple { diff --git a/src/ripple/app/data/DatabaseCon.h b/src/ripple/app/data/DatabaseCon.h index 3954c3394..d72231e20 100644 --- a/src/ripple/app/data/DatabaseCon.h +++ b/src/ripple/app/data/DatabaseCon.h @@ -20,8 +20,9 @@ #ifndef RIPPLE_DATABASECON_H #define RIPPLE_DATABASECON_H +#include #include - +#include #include #include diff --git a/src/ripple/app/data/SqliteDatabase.cpp b/src/ripple/app/data/SqliteDatabase.cpp index f7695ccac..7adbbc278 100644 --- a/src/ripple/app/data/SqliteDatabase.cpp +++ b/src/ripple/app/data/SqliteDatabase.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/app/data/SqliteDatabase.h b/src/ripple/app/data/SqliteDatabase.h index 664057c6f..aca6c7def 100644 --- a/src/ripple/app/data/SqliteDatabase.h +++ b/src/ripple/app/data/SqliteDatabase.h @@ -20,6 +20,10 @@ #ifndef RIPPLE_SQLITEDATABASE_H_INCLUDED #define RIPPLE_SQLITEDATABASE_H_INCLUDED +#include +#include +#include +#include #include #include diff --git a/src/ripple/app/impl/BasicApp.cpp b/src/ripple/app/impl/BasicApp.cpp index 8e65069d0..d7318ae28 100644 --- a/src/ripple/app/impl/BasicApp.cpp +++ b/src/ripple/app/impl/BasicApp.cpp @@ -17,7 +17,9 @@ */ //============================================================================== +#include #include +#include BasicApp::BasicApp(std::size_t numberOfThreads) { diff --git a/src/ripple/app/ledger/AcceptedLedger.cpp b/src/ripple/app/ledger/AcceptedLedger.cpp index c383571ed..ff1201ebb 100644 --- a/src/ripple/app/ledger/AcceptedLedger.cpp +++ b/src/ripple/app/ledger/AcceptedLedger.cpp @@ -17,7 +17,9 @@ */ //============================================================================== +#include #include +#include #include namespace ripple { diff --git a/src/ripple/app/ledger/AcceptedLedger.h b/src/ripple/app/ledger/AcceptedLedger.h index 25bf4638f..639703ea4 100644 --- a/src/ripple/app/ledger/AcceptedLedger.h +++ b/src/ripple/app/ledger/AcceptedLedger.h @@ -20,6 +20,8 @@ #ifndef RIPPLE_ACCEPTEDLEDGER_H #define RIPPLE_ACCEPTEDLEDGER_H +#include + namespace ripple { /** A ledger that has become irrevocable. diff --git a/src/ripple/app/ledger/AcceptedLedgerTx.cpp b/src/ripple/app/ledger/AcceptedLedgerTx.cpp index 748eaae1b..a3ee78f4d 100644 --- a/src/ripple/app/ledger/AcceptedLedgerTx.cpp +++ b/src/ripple/app/ledger/AcceptedLedgerTx.cpp @@ -17,6 +17,9 @@ */ //============================================================================== +#include +#include +#include #include #include #include diff --git a/src/ripple/app/ledger/AcceptedLedgerTx.h b/src/ripple/app/ledger/AcceptedLedgerTx.h index 0177ae03d..187ee0c36 100644 --- a/src/ripple/app/ledger/AcceptedLedgerTx.h +++ b/src/ripple/app/ledger/AcceptedLedgerTx.h @@ -20,6 +20,8 @@ #ifndef RIPPLE_ACCEPTEDLEDGERTX_H #define RIPPLE_ACCEPTEDLEDGERTX_H +#include + namespace ripple { /** diff --git a/src/ripple/app/ledger/AccountStateSF.cpp b/src/ripple/app/ledger/AccountStateSF.cpp index d4e912154..7ef576a1d 100644 --- a/src/ripple/app/ledger/AccountStateSF.cpp +++ b/src/ripple/app/ledger/AccountStateSF.cpp @@ -17,7 +17,10 @@ */ //============================================================================== +#include #include +#include +#include #include #include #include @@ -35,6 +38,9 @@ void AccountStateSF::gotNode (bool fromFilter, Blob& nodeData, SHAMapTreeNode::TNType) { + // VFALCO SHAMapSync filters should be passed the SHAMap, the + // SHAMap should provide an accessor to get the injected Database, + // and this should use that Database instad of getNodeStore getApp().getNodeStore ().store (hotACCOUNT_NODE, mLedgerSeq, std::move (nodeData), nodeHash); } diff --git a/src/ripple/app/ledger/BookListeners.cpp b/src/ripple/app/ledger/BookListeners.cpp index 9784c36cc..c4edc29cd 100644 --- a/src/ripple/app/ledger/BookListeners.cpp +++ b/src/ripple/app/ledger/BookListeners.cpp @@ -17,6 +17,9 @@ */ //============================================================================== +#include +#include +#include #include namespace ripple { diff --git a/src/ripple/app/ledger/BookListeners.h b/src/ripple/app/ledger/BookListeners.h index 7657f282b..dac8e679a 100644 --- a/src/ripple/app/ledger/BookListeners.h +++ b/src/ripple/app/ledger/BookListeners.h @@ -20,6 +20,9 @@ #ifndef RIPPLE_BOOKLISTENERS_H #define RIPPLE_BOOKLISTENERS_H +#include +#include + namespace ripple { /** Listen to public/subscribe messages from a book. */ diff --git a/src/ripple/app/ledger/ConsensusTransSetSF.cpp b/src/ripple/app/ledger/ConsensusTransSetSF.cpp index da1a5cd90..eaa59e9ad 100644 --- a/src/ripple/app/ledger/ConsensusTransSetSF.cpp +++ b/src/ripple/app/ledger/ConsensusTransSetSF.cpp @@ -17,8 +17,13 @@ */ //============================================================================== +#include #include +#include +#include #include +#include +#include #include #include diff --git a/src/ripple/app/ledger/DirectoryEntryIterator.cpp b/src/ripple/app/ledger/DirectoryEntryIterator.cpp index 47e89eeb6..9998eb988 100644 --- a/src/ripple/app/ledger/DirectoryEntryIterator.cpp +++ b/src/ripple/app/ledger/DirectoryEntryIterator.cpp @@ -17,6 +17,10 @@ */ //============================================================================== +#include +#include +#include + namespace ripple { /** Get the current ledger entry */ diff --git a/src/ripple/app/ledger/DirectoryEntryIterator.h b/src/ripple/app/ledger/DirectoryEntryIterator.h index 7a1e28ccc..0fa87d730 100644 --- a/src/ripple/app/ledger/DirectoryEntryIterator.h +++ b/src/ripple/app/ledger/DirectoryEntryIterator.h @@ -20,6 +20,10 @@ #ifndef RIPPLE_DIRECTORYENTRYITERATOR_H_INCLUDED #define RIPPLE_DIRECTORYENTRYITERATOR_H_INCLUDED +#include +#include +#include + namespace ripple { /** An iterator that walks the ledger entries in a single directory */ diff --git a/src/ripple/app/ledger/InboundLedger.cpp b/src/ripple/app/ledger/InboundLedger.cpp index 7152164a4..6f5788b76 100644 --- a/src/ripple/app/ledger/InboundLedger.cpp +++ b/src/ripple/app/ledger/InboundLedger.cpp @@ -17,9 +17,15 @@ */ //============================================================================== +#include #include #include +#include +#include +#include #include +#include +#include #include #include #include diff --git a/src/ripple/app/ledger/InboundLedger.h b/src/ripple/app/ledger/InboundLedger.h index c33845378..8689f03ce 100644 --- a/src/ripple/app/ledger/InboundLedger.h +++ b/src/ripple/app/ledger/InboundLedger.h @@ -20,7 +20,9 @@ #ifndef RIPPLE_INBOUNDLEDGER_H #define RIPPLE_INBOUNDLEDGER_H +#include #include +#include #include namespace ripple { diff --git a/src/ripple/app/ledger/InboundLedgers.cpp b/src/ripple/app/ledger/InboundLedgers.cpp index 593c2823c..f9670adfa 100644 --- a/src/ripple/app/ledger/InboundLedgers.cpp +++ b/src/ripple/app/ledger/InboundLedgers.cpp @@ -17,7 +17,10 @@ */ //============================================================================== +#include #include +#include +#include #include #include #include // diff --git a/src/ripple/app/ledger/Ledger.cpp b/src/ripple/app/ledger/Ledger.cpp index 36badfaca..b532ca7bb 100644 --- a/src/ripple/app/ledger/Ledger.cpp +++ b/src/ripple/app/ledger/Ledger.cpp @@ -17,11 +17,25 @@ */ //============================================================================== +#include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include #include +#include +#include +#include #include #include #include +#include #include #include #include diff --git a/src/ripple/app/ledger/Ledger.test.cpp b/src/ripple/app/ledger/Ledger.test.cpp index a35a9334d..73aa15f1f 100644 --- a/src/ripple/app/ledger/Ledger.test.cpp +++ b/src/ripple/app/ledger/Ledger.test.cpp @@ -18,11 +18,16 @@ //============================================================================== #include +#include +#include +#include #include #include +#include #include #include #include +#include namespace ripple { diff --git a/src/ripple/app/ledger/LedgerCleaner.cpp b/src/ripple/app/ledger/LedgerCleaner.cpp index 90c35c104..11ab90312 100644 --- a/src/ripple/app/ledger/LedgerCleaner.cpp +++ b/src/ripple/app/ledger/LedgerCleaner.cpp @@ -17,8 +17,15 @@ */ //============================================================================== +#include #include +#include +#include +#include +#include #include +#include +#include #include #include // #include diff --git a/src/ripple/app/ledger/LedgerCleaner.h b/src/ripple/app/ledger/LedgerCleaner.h index 794f5d188..177ed7171 100644 --- a/src/ripple/app/ledger/LedgerCleaner.h +++ b/src/ripple/app/ledger/LedgerCleaner.h @@ -20,10 +20,11 @@ #ifndef RIPPLE_LEDGERCLEANER_H_INCLUDED #define RIPPLE_LEDGERCLEANER_H_INCLUDED -#include // +#include #include #include #include +#include namespace ripple { diff --git a/src/ripple/app/ledger/LedgerEntrySet.cpp b/src/ripple/app/ledger/LedgerEntrySet.cpp index cc1d81675..61ac90863 100644 --- a/src/ripple/app/ledger/LedgerEntrySet.cpp +++ b/src/ripple/app/ledger/LedgerEntrySet.cpp @@ -17,9 +17,13 @@ */ //============================================================================== +#include #include +#include #include #include +#include +#include namespace ripple { diff --git a/src/ripple/app/ledger/LedgerEntrySet.h b/src/ripple/app/ledger/LedgerEntrySet.h index b3625374d..4fddf33af 100644 --- a/src/ripple/app/ledger/LedgerEntrySet.h +++ b/src/ripple/app/ledger/LedgerEntrySet.h @@ -20,8 +20,14 @@ #ifndef RIPPLE_LEDGERENTRYSET_H #define RIPPLE_LEDGERENTRYSET_H +#include +#include +#include + namespace ripple { +// VFALCO Does this belong here? Is it correctly named? + enum TransactionEngineParams { tapNONE = 0x00, diff --git a/src/ripple/app/ledger/LedgerHistory.cpp b/src/ripple/app/ledger/LedgerHistory.cpp index f833ad32b..e34d07e50 100644 --- a/src/ripple/app/ledger/LedgerHistory.cpp +++ b/src/ripple/app/ledger/LedgerHistory.cpp @@ -17,8 +17,10 @@ */ //============================================================================== -#include +#include #include +#include +#include namespace ripple { diff --git a/src/ripple/app/ledger/LedgerHistory.h b/src/ripple/app/ledger/LedgerHistory.h index 061b7aea9..28a1b97c7 100644 --- a/src/ripple/app/ledger/LedgerHistory.h +++ b/src/ripple/app/ledger/LedgerHistory.h @@ -20,7 +20,9 @@ #ifndef RIPPLE_LEDGERHISTORY_H #define RIPPLE_LEDGERHISTORY_H +#include #include +#include #include namespace ripple { @@ -28,7 +30,7 @@ namespace ripple { // VFALCO TODO Rename to OldLedgers ? /** Retains historical ledgers. */ -class LedgerHistory : beast::LeakChecked +class LedgerHistory { public: explicit diff --git a/src/ripple/app/ledger/LedgerMaster.cpp b/src/ripple/app/ledger/LedgerMaster.cpp index 663eed7a0..cd5f73330 100644 --- a/src/ripple/app/ledger/LedgerMaster.cpp +++ b/src/ripple/app/ledger/LedgerMaster.cpp @@ -17,14 +17,27 @@ */ //============================================================================== -#include +#include #include +#include +#include #include #include #include -#include -#include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include // diff --git a/src/ripple/app/ledger/LedgerMaster.h b/src/ripple/app/ledger/LedgerMaster.h index 850d220c7..f7e331d0d 100644 --- a/src/ripple/app/ledger/LedgerMaster.h +++ b/src/ripple/app/ledger/LedgerMaster.h @@ -20,6 +20,7 @@ #ifndef RIPPLE_LEDGERMASTER_H_INCLUDED #define RIPPLE_LEDGERMASTER_H_INCLUDED +#include #include #include #include diff --git a/src/ripple/app/ledger/LedgerProposal.cpp b/src/ripple/app/ledger/LedgerProposal.cpp index d060ffe1c..9fd843476 100644 --- a/src/ripple/app/ledger/LedgerProposal.cpp +++ b/src/ripple/app/ledger/LedgerProposal.cpp @@ -17,8 +17,11 @@ */ //============================================================================== +#include +#include #include #include +#include namespace ripple { @@ -36,7 +39,6 @@ LedgerProposal::LedgerProposal (uint256 const& pLgr, std::uint32_t seq, mTime = boost::posix_time::second_clock::universal_time (); } - LedgerProposal::LedgerProposal (RippleAddress const& naPub, RippleAddress const& naPriv, uint256 const& prevLgr, uint256 const& position, std::uint32_t closeTime) : diff --git a/src/ripple/app/ledger/LedgerProposal.h b/src/ripple/app/ledger/LedgerProposal.h index c0a57da0b..229b1e8eb 100644 --- a/src/ripple/app/ledger/LedgerProposal.h +++ b/src/ripple/app/ledger/LedgerProposal.h @@ -17,8 +17,16 @@ */ //============================================================================== -#ifndef __PROPOSELEDGER__ -#define __PROPOSELEDGER__ +#ifndef RIPPLE_APP_LEDGERPROPOSAL_H_INCLUDED +#define RIPPLE_APP_LEDGERPROPOSAL_H_INCLUDED + +#include +#include +#include +#include +#include +#include +#include namespace ripple { diff --git a/src/ripple/app/ledger/LedgerTiming.cpp b/src/ripple/app/ledger/LedgerTiming.cpp index c5d0abdbf..6ff9d21f8 100644 --- a/src/ripple/app/ledger/LedgerTiming.cpp +++ b/src/ripple/app/ledger/LedgerTiming.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include diff --git a/src/ripple/app/ledger/OrderBookDB.cpp b/src/ripple/app/ledger/OrderBookDB.cpp index e2478e8de..3bc1a6afd 100644 --- a/src/ripple/app/ledger/OrderBookDB.cpp +++ b/src/ripple/app/ledger/OrderBookDB.cpp @@ -17,6 +17,15 @@ */ //============================================================================== +#include +#include +#include +#include +#include +#include +#include +#include + namespace ripple { OrderBookDB::OrderBookDB (Stoppable& parent) diff --git a/src/ripple/app/ledger/OrderBookIterator.cpp b/src/ripple/app/ledger/OrderBookIterator.cpp index e29bf30df..1f91444c1 100644 --- a/src/ripple/app/ledger/OrderBookIterator.cpp +++ b/src/ripple/app/ledger/OrderBookIterator.cpp @@ -17,6 +17,10 @@ */ //============================================================================== +#include +#include +#include + namespace ripple { /** Iterate through the directories in an order book */ diff --git a/src/ripple/app/ledger/OrderBookIterator.h b/src/ripple/app/ledger/OrderBookIterator.h index 0f6bdebb2..fd4100014 100644 --- a/src/ripple/app/ledger/OrderBookIterator.h +++ b/src/ripple/app/ledger/OrderBookIterator.h @@ -20,6 +20,11 @@ #ifndef RIPPLE_ORDERBOOKITERATOR_H_INCLUDED #define RIPPLE_ORDERBOOKITERATOR_H_INCLUDED +#include +#include + +// VFALCO TODO Split these to separate files and de-inline the definitions + namespace ripple { /** An iterator that walks the directories in a book */ diff --git a/src/ripple/app/ledger/TransactionStateSF.cpp b/src/ripple/app/ledger/TransactionStateSF.cpp index 913a6e1e2..af83add86 100644 --- a/src/ripple/app/ledger/TransactionStateSF.cpp +++ b/src/ripple/app/ledger/TransactionStateSF.cpp @@ -17,7 +17,10 @@ */ //============================================================================== +#include #include +#include +#include #include #include #include @@ -35,6 +38,9 @@ void TransactionStateSF::gotNode (bool fromFilter, Blob& nodeData, SHAMapTreeNode::TNType type) { + // VFALCO SHAMapSync filters should be passed the SHAMap, the + // SHAMap should provide an accessor to get the injected Database, + // and this should use that Database instad of getNodeStore getApp().getNodeStore ().store ( (type == SHAMapTreeNode::tnTRANSACTION_NM) ? hotTRANSACTION : hotTRANSACTION_NODE, mLedgerSeq, diff --git a/src/ripple/app/main/Application.cpp b/src/ripple/app/main/Application.cpp index 306ea1ba9..e563582c5 100644 --- a/src/ripple/app/main/Application.cpp +++ b/src/ripple/app/main/Application.cpp @@ -17,16 +17,38 @@ */ //============================================================================== +#include +#include +#include +#include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include #include +#include +#include +#include +#include #include #include +#include #include #include #include #include +#include #include #include #include diff --git a/src/ripple/app/main/CollectorManager.cpp b/src/ripple/app/main/CollectorManager.cpp index 2b32ceb18..5e5d2cfd3 100644 --- a/src/ripple/app/main/CollectorManager.cpp +++ b/src/ripple/app/main/CollectorManager.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/app/main/LoadManager.cpp b/src/ripple/app/main/LoadManager.cpp index 5ef961f1b..de4a66b1d 100644 --- a/src/ripple/app/main/LoadManager.cpp +++ b/src/ripple/app/main/LoadManager.cpp @@ -17,9 +17,17 @@ */ //============================================================================== +#include +#include +#include +#include #include +#include #include +#include +#include #include // +#include namespace ripple { @@ -31,7 +39,7 @@ public: //-------------------------------------------------------------------------- beast::Journal m_journal; - typedef RippleMutex LockType; + using LockType = std::mutex; typedef std::lock_guard ScopedLockType; LockType mLock; diff --git a/src/ripple/app/main/LocalCredentials.cpp b/src/ripple/app/main/LocalCredentials.cpp index 36ada486d..be24ea883 100644 --- a/src/ripple/app/main/LocalCredentials.cpp +++ b/src/ripple/app/main/LocalCredentials.cpp @@ -17,14 +17,19 @@ */ //============================================================================== +#include +#include +#include +#include +#include +#include #include #include #include +#include namespace ripple { -LocalCredentials::LocalCredentials () = default; - void LocalCredentials::start () { // We need our node identity before we begin networking. diff --git a/src/ripple/app/main/LocalCredentials.h b/src/ripple/app/main/LocalCredentials.h index f942c5b93..a2e482b72 100644 --- a/src/ripple/app/main/LocalCredentials.h +++ b/src/ripple/app/main/LocalCredentials.h @@ -20,13 +20,17 @@ #ifndef RIPPLE_LOCALCREDENTIALS_H #define RIPPLE_LOCALCREDENTIALS_H +#include +#include +#include + namespace ripple { /** Holds the cryptographic credentials identifying this instance of the server. */ class LocalCredentials { public: - LocalCredentials (); + LocalCredentials () = default; LocalCredentials (LocalCredentials const&) = delete; LocalCredentials& operator= (LocalCredentials const&) = delete; diff --git a/src/ripple/app/main/Main.cpp b/src/ripple/app/main/Main.cpp index 67a9b68d2..4b2186bf1 100644 --- a/src/ripple/app/main/Main.cpp +++ b/src/ripple/app/main/Main.cpp @@ -17,18 +17,29 @@ */ //============================================================================== +#include +#include +#include #include +#include #include #include +#include #include #include #include #include #include +#include +#include #include +#include #include +#include #include +#include #include +#include #if defined(BEAST_LINUX) || defined(BEAST_MAC) || defined(BEAST_BSD) #include @@ -398,4 +409,55 @@ int run (int argc, char** argv) return iResult; } +extern int run (int argc, char** argv); + +} // ripple + +// Must be outside the namespace for obvious reasons +// +int main (int argc, char** argv) +{ + // Workaround for Boost.Context / Boost.Coroutine + // https://svn.boost.org/trac/boost/ticket/10657 + (void)beast::Time::currentTimeMillis(); + +#if defined(__GNUC__) && !defined(__clang__) + auto constexpr gccver = (__GNUC__ * 100 * 100) + + (__GNUC_MINOR__ * 100) + + __GNUC_PATCHLEVEL__; + + static_assert (gccver >= 40801, + "GCC version 4.8.1 or later is required to compile rippled."); +#endif + + static_assert (BOOST_VERSION >= 105500, + "Boost version 1.55 or later is required to compile rippled"); + + // + // These debug heap calls do nothing in release or non Visual Studio builds. + // + + // Checks the heap at every allocation and deallocation (slow). + // + //beast::Debug::setAlwaysCheckHeap (false); + + // Keeps freed memory blocks and fills them with a guard value. + // + //beast::Debug::setHeapDelayedFree (false); + + // At exit, reports all memory blocks which have not been freed. + // +#if RIPPLE_DUMP_LEAKS_ON_EXIT + beast::Debug::setHeapReportLeaks (true); +#else + beast::Debug::setHeapReportLeaks (false); +#endif + + atexit(&google::protobuf::ShutdownProtobufLibrary); + + auto const result (ripple::run (argc, argv)); + + beast::basic_seconds_clock_main_hook(); + + return result; } diff --git a/src/ripple/app/main/NodeStoreScheduler.cpp b/src/ripple/app/main/NodeStoreScheduler.cpp index 2f5533f42..117a322af 100644 --- a/src/ripple/app/main/NodeStoreScheduler.cpp +++ b/src/ripple/app/main/NodeStoreScheduler.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/app/main/ParameterTable.cpp b/src/ripple/app/main/ParameterTable.cpp deleted file mode 100644 index 2a0ae9c97..000000000 --- a/src/ripple/app/main/ParameterTable.cpp +++ /dev/null @@ -1,198 +0,0 @@ -//------------------------------------------------------------------------------ -/* - This file is part of rippled: https://github.com/ripple/rippled - Copyright (c) 2012, 2013 Ripple Labs Inc. - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ -//============================================================================== - -#include -#include - -namespace ripple { - -bool ParameterNode::setValue (std::string const& name, Json::Value const& value, Json::Value& error) -{ - if (name.empty ()) // this node - return setValue (value, error); - - size_t dot = name.find ('.'); - - if (dot == std::string::npos) // a child of this node - { - std::map::iterator it = mChildren.find (name); - - if (it == mChildren.end ()) - { - error = Json::objectValue; - error[jss::error] = "Name not found"; - error[jss::name] = name; - return false; - } - - return it->second->setValue (value, error); - } - - std::map::iterator it = mChildren.find (name.substr (0, dot)); - - if (it == mChildren.end ()) - { - error = Json::objectValue; - error[jss::error] = "Name not found"; - error[jss::name] = name; - return false; - } - - ParameterNode* n = dynamic_cast (it->second.get ()); - - if (!n) - { - error = Json::objectValue; - error[jss::error] = "Node has no children"; - error[jss::name] = it->second->getName (); - return false; - } - - return n->setValue (name.substr (dot + 1), value, error); -} - -bool ParameterNode::addNode (std::string const& name, Parameter::ref node) -{ - if (name.empty ()) // this node - return false; - - size_t dot = name.find ('.'); - - if (dot == std::string::npos) // a child of this node - { - std::map::iterator it = mChildren.find (name); - - if (it != mChildren.end ()) - return false; - - mChildren[name] = node; - return true; - } - - std::map::iterator it = mChildren.find (name.substr (0, dot)); - ParameterNode* n; - - if (it == mChildren.end ()) - { - // create a new inner node - ParameterNode::pointer node = std::make_shared (getShared (), name.substr (0, dot)); - n = dynamic_cast (node.get ()); - assert (n); - mChildren[name] = node; - } - else - { - // existing node passed through must be inner - n = dynamic_cast (it->second.get ()); - - if (!n) - return false; - } - - return n->addNode (name.substr (dot + 1), node); -} - -Json::Value ParameterNode::getValue (int i) const -{ - Json::Value v (Json::objectValue); - typedef std::map::value_type string_ref_pair; - BOOST_FOREACH (const string_ref_pair & it, mChildren) - { - v[it.first] = it.second->getValue (i); - } - return v; -} - -bool ParameterNode::setValue (Json::Value const& value, Json::Value& error) -{ - error = Json::objectValue; - error[jss::error] = "Cannot end on an inner node"; - - Json::Value nodes (Json::arrayValue); - typedef std::map::value_type string_ref_pair; - BOOST_FOREACH (const string_ref_pair & it, mChildren) - { - nodes.append (it.first); - } - error["legal_nodes"] = nodes; - return false; -} - -ParameterString::ParameterString (Parameter::ref parent, std::string const& name, std::string const& value) - : Parameter (parent, name), mValue (value) -{ - ; -} - -Json::Value ParameterString::getValue (int) const -{ - return Json::Value (mValue); -} - -bool ParameterString::setValue (Json::Value const& value, Json::Value& error) -{ - if (!value.isConvertibleTo (Json::stringValue)) - { - error = Json::objectValue; - error[jss::error] = "Cannot convert to string"; - error[jss::value] = value; - return false; - } - - mValue = value.asString (); - return true; -} - -ParameterInt::ParameterInt (Parameter::ref parent, std::string const& name, int value) - : Parameter (parent, name), mValue (value) -{ - ; -} - -Json::Value ParameterInt::getValue (int) const -{ - return Json::Value (mValue); -} - -bool ParameterInt::setValue (Json::Value const& value, Json::Value& error) -{ - if (value.isConvertibleTo (Json::intValue)) - { - mValue = value.asInt (); - return true; - } - - if (value.isConvertibleTo (Json::stringValue)) - { - try - { - mValue = beast::lexicalCastThrow (value.asString ()); - } - catch (...) - { - } - } - - error = Json::objectValue; - error[jss::error] = "Cannot convert to integer"; - error[jss::value] = value; - return false; -} - -} // ripple diff --git a/src/ripple/app/main/ParameterTable.h b/src/ripple/app/main/ParameterTable.h deleted file mode 100644 index e80cfda2b..000000000 --- a/src/ripple/app/main/ParameterTable.h +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -/* - This file is part of rippled: https://github.com/ripple/rippled - Copyright (c) 2012, 2013 Ripple Labs Inc. - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ -//============================================================================== - -#ifndef RIPPLE_PARAMETERTABLE_H -#define RIPPLE_PARAMETERTABLE_H - -namespace ripple { - -class Parameter : public std::enable_shared_from_this -{ - // abstract base class parameters are derived from -public: - typedef std::shared_ptr pointer; - typedef const std::shared_ptr& ref; - -public: - Parameter (Parameter::ref parent, std::string const& name) : mParent (parent), mName (name) - { - ; - } - virtual ~Parameter () - { - ; - } - - std::string const& getName () const - { - return mName; - } - - virtual Json::Value getValue (int) const = 0; - virtual bool setValue (Json::Value const& value, Json::Value& error) = 0; - - Parameter::pointer getShared () - { - return shared_from_this (); - } - -private: - pointer mParent; - std::string mName; -}; - -class ParameterNode : public Parameter -{ -public: - ParameterNode (Parameter::ref parent, std::string const& name) : Parameter (parent, name) - { - ; - } - bool addChildNode (Parameter::ref node); - - bool setValue (std::string const& name, Json::Value const& value, Json::Value& error); - bool addNode (std::string const& name, Parameter::ref node); - - virtual Json::Value getValue (int) const; - virtual bool setValue (Json::Value const& value, Json::Value& error); - -private: - std::map mChildren; -}; - -class ParameterString : public Parameter -{ -public: - ParameterString (Parameter::ref parent, std::string const& name, std::string const& value); - virtual Json::Value getValue (int) const; - virtual bool setValue (Json::Value const& value, Json::Value& error); - -private: - std::string mValue; -}; - -class ParameterInt : public Parameter -{ -public: - ParameterInt (Parameter::ref parent, std::string const& name, int value); - virtual Json::Value getValue (int) const; - virtual bool setValue (Json::Value const& value, Json::Value& error); - -private: - int mValue; -}; - -} // ripple - -#endif diff --git a/src/ripple/app/misc/AccountState.cpp b/src/ripple/app/misc/AccountState.cpp index 45d3bbe78..b54ebffe0 100644 --- a/src/ripple/app/misc/AccountState.cpp +++ b/src/ripple/app/misc/AccountState.cpp @@ -17,7 +17,13 @@ */ //============================================================================== +#include +#include +#include #include +#include +#include +#include #include namespace ripple { diff --git a/src/ripple/app/misc/AccountState.h b/src/ripple/app/misc/AccountState.h index 2506c6691..e0a594a5b 100644 --- a/src/ripple/app/misc/AccountState.h +++ b/src/ripple/app/misc/AccountState.h @@ -20,13 +20,18 @@ #ifndef RIPPLE_ACCOUNTSTATE_H #define RIPPLE_ACCOUNTSTATE_H +#include +#include +#include +#include + namespace ripple { // // Provide abstract access to an account's state, such that access to the serialized format is hidden. // -class AccountState : beast::LeakChecked +class AccountState { public: typedef std::shared_ptr pointer; diff --git a/src/ripple/app/misc/AmendmentTableImpl.cpp b/src/ripple/app/misc/AmendmentTableImpl.cpp index 8cb7b3436..75da35b18 100644 --- a/src/ripple/app/misc/AmendmentTableImpl.cpp +++ b/src/ripple/app/misc/AmendmentTableImpl.cpp @@ -17,6 +17,13 @@ */ //============================================================================== +#include +#include +#include +#include +#include +#include + namespace ripple { /** Track the list of "amendments" @@ -25,10 +32,9 @@ namespace ripple { rules that is identified by a 256-bit amendment identifier and adopted, or rejected, by the network. */ - class AmendmentTableImpl : public AmendmentTable +class AmendmentTableImpl : public AmendmentTable { protected: - typedef hash_map amendmentMap_t; typedef std::pair amendmentIt_t; typedef hash_set amendmentList_t; @@ -49,7 +55,6 @@ protected: void setJson (Json::Value& v, const AmendmentState&); public: - AmendmentTableImpl (std::chrono::seconds majorityTime, int majorityFraction, beast::Journal journal) : m_majorityTime (majorityTime) diff --git a/src/ripple/app/misc/CanonicalTXSet.cpp b/src/ripple/app/misc/CanonicalTXSet.cpp index f2be1614a..f5f0cfa35 100644 --- a/src/ripple/app/misc/CanonicalTXSet.cpp +++ b/src/ripple/app/misc/CanonicalTXSet.cpp @@ -17,6 +17,9 @@ */ //============================================================================== +#include +#include + namespace ripple { bool CanonicalTXSet::Key::operator< (Key const& rhs) const diff --git a/src/ripple/app/misc/CanonicalTXSet.h b/src/ripple/app/misc/CanonicalTXSet.h index ec3468dbd..e028d9d05 100644 --- a/src/ripple/app/misc/CanonicalTXSet.h +++ b/src/ripple/app/misc/CanonicalTXSet.h @@ -21,6 +21,7 @@ #define RIPPLE_CANONICALTXSET_H #include +#include namespace ripple { @@ -32,7 +33,7 @@ namespace ripple { */ // VFALCO TODO rename to SortedTxSet -class CanonicalTXSet : beast::LeakChecked +class CanonicalTXSet { public: class Key diff --git a/src/ripple/app/misc/DefaultMissingNodeHandler.cpp b/src/ripple/app/misc/DefaultMissingNodeHandler.cpp index 791b18265..4f30507d5 100644 --- a/src/ripple/app/misc/DefaultMissingNodeHandler.cpp +++ b/src/ripple/app/misc/DefaultMissingNodeHandler.cpp @@ -17,7 +17,9 @@ */ //============================================================================== +#include #include +#include #include namespace ripple { diff --git a/src/ripple/app/misc/FeeVote.h b/src/ripple/app/misc/FeeVote.h index d4694ff2b..1c8566228 100644 --- a/src/ripple/app/misc/FeeVote.h +++ b/src/ripple/app/misc/FeeVote.h @@ -20,6 +20,7 @@ #ifndef RIPPLE_APP_FEEVOTE_H_INCLUDED #define RIPPLE_APP_FEEVOTE_H_INCLUDED +#include #include #include diff --git a/src/ripple/app/misc/FeeVoteImpl.cpp b/src/ripple/app/misc/FeeVoteImpl.cpp index b59f3c5d7..6a5188138 100644 --- a/src/ripple/app/misc/FeeVoteImpl.cpp +++ b/src/ripple/app/misc/FeeVoteImpl.cpp @@ -17,6 +17,13 @@ */ //============================================================================== +#include +#include +#include +#include +#include +#include + namespace ripple { namespace detail { diff --git a/src/ripple/app/misc/HashRouter.cpp b/src/ripple/app/misc/HashRouter.cpp index e9aa8af25..fc9e06712 100644 --- a/src/ripple/app/misc/HashRouter.cpp +++ b/src/ripple/app/misc/HashRouter.cpp @@ -17,8 +17,14 @@ */ //============================================================================== +#include +#include +#include +#include #include #include +#include +#include namespace ripple { @@ -105,8 +111,8 @@ private: Entry& findCreateEntry (uint256 const& , bool& created); - typedef RippleMutex LockType; - typedef std::lock_guard ScopedLockType; + using LockType = std::mutex; + using ScopedLockType = std::lock_guard ; LockType mLock; // Stores all suppressed hashes and their expiration time diff --git a/src/ripple/app/misc/IHashRouter.h b/src/ripple/app/misc/IHashRouter.h index a3cacfac1..3f3686016 100644 --- a/src/ripple/app/misc/IHashRouter.h +++ b/src/ripple/app/misc/IHashRouter.h @@ -20,6 +20,7 @@ #ifndef RIPPLE_HASHROUTER_H_INCLUDED #define RIPPLE_HASHROUTER_H_INCLUDED +#include #include #include diff --git a/src/ripple/app/misc/NetworkOPs.cpp b/src/ripple/app/misc/NetworkOPs.cpp index 7a1f03f36..fa26e2b4d 100644 --- a/src/ripple/app/misc/NetworkOPs.cpp +++ b/src/ripple/app/misc/NetworkOPs.cpp @@ -17,9 +17,28 @@ */ //============================================================================== +#include #include +#include +#include +#include #include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -29,9 +48,11 @@ #include #include #include +#include #include #include #include +#include #include #include #include @@ -93,7 +114,7 @@ public: { } - ~NetworkOPsImp () + ~NetworkOPsImp() { } diff --git a/src/ripple/app/misc/NetworkOPs.h b/src/ripple/app/misc/NetworkOPs.h index 40be2f597..fb0879ad8 100644 --- a/src/ripple/app/misc/NetworkOPs.h +++ b/src/ripple/app/misc/NetworkOPs.h @@ -20,6 +20,7 @@ #ifndef RIPPLE_NETWORKOPS_H #define RIPPLE_NETWORKOPS_H +#include #include #include #include @@ -38,6 +39,7 @@ namespace ripple { class Peer; class LedgerConsensus; +class LedgerMaster; // This is the primary interface into the "client" portion of the program. // Code that wants to do normal operations on the network such as diff --git a/src/ripple/app/misc/SHAMapStore.h b/src/ripple/app/misc/SHAMapStore.h index 377f51159..320e5591d 100644 --- a/src/ripple/app/misc/SHAMapStore.h +++ b/src/ripple/app/misc/SHAMapStore.h @@ -20,10 +20,13 @@ #ifndef RIPPLE_APP_SHAMAPSTORE_H_INCLUDED #define RIPPLE_APP_SHAMAPSTORE_H_INCLUDED +#include +#include #include #include #include #include +#include namespace ripple { diff --git a/src/ripple/app/misc/SHAMapStoreImp.cpp b/src/ripple/app/misc/SHAMapStoreImp.cpp index d4d09efba..02b51a51a 100644 --- a/src/ripple/app/misc/SHAMapStoreImp.cpp +++ b/src/ripple/app/misc/SHAMapStoreImp.cpp @@ -17,7 +17,11 @@ */ //============================================================================== +#include #include +#include +#include +#include #include // namespace ripple { @@ -548,8 +552,8 @@ SHAMapStoreImp::clearSql (DatabaseCon& database, boost::format formattedDeleteQuery (deleteQuery); - journal_.debug << "start: " << deleteQuery << " from " - << min << " to " << lastRotated; + if (journal_.debug) journal_.debug << + "start: " << deleteQuery << " from " << min << " to " << lastRotated; while (min < lastRotated) { min = (min + setup_.deleteBatch >= lastRotated) ? lastRotated : diff --git a/src/ripple/app/misc/SHAMapStoreImp.h b/src/ripple/app/misc/SHAMapStoreImp.h index e2a83381e..b4dfb627f 100644 --- a/src/ripple/app/misc/SHAMapStoreImp.h +++ b/src/ripple/app/misc/SHAMapStoreImp.h @@ -20,6 +20,7 @@ #ifndef RIPPLE_APP_SHAMAPSTOREIMP_H_INCLUDED #define RIPPLE_APP_SHAMAPSTOREIMP_H_INCLUDED +#include #include #include #include diff --git a/src/ripple/app/misc/Validations.cpp b/src/ripple/app/misc/Validations.cpp index f26da6bce..05de97c7e 100644 --- a/src/ripple/app/misc/Validations.cpp +++ b/src/ripple/app/misc/Validations.cpp @@ -17,6 +17,15 @@ */ //============================================================================== +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include diff --git a/src/ripple/app/node/SqliteFactory.cpp b/src/ripple/app/node/SqliteFactory.cpp index cd7d776ee..2610ac125 100644 --- a/src/ripple/app/node/SqliteFactory.cpp +++ b/src/ripple/app/node/SqliteFactory.cpp @@ -17,9 +17,13 @@ */ //============================================================================== +#include #include +#include +#include #include #include +#include // namespace ripple { diff --git a/src/ripple/app/paths/AccountCurrencies.cpp b/src/ripple/app/paths/AccountCurrencies.cpp index 139dabf11..39026f6e9 100644 --- a/src/ripple/app/paths/AccountCurrencies.cpp +++ b/src/ripple/app/paths/AccountCurrencies.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/app/paths/AccountCurrencies.h b/src/ripple/app/paths/AccountCurrencies.h index 627c52adb..207fc3475 100644 --- a/src/ripple/app/paths/AccountCurrencies.h +++ b/src/ripple/app/paths/AccountCurrencies.h @@ -20,6 +20,8 @@ #ifndef RIPPLED_RIPPLE_APP_PATHS_ACCOUNTCURRENCIES_H #define RIPPLED_RIPPLE_APP_PATHS_ACCOUNTCURRENCIES_H +#include + namespace ripple { CurrencySet accountDestCurrencies diff --git a/src/ripple/app/paths/Credit.cpp b/src/ripple/app/paths/Credit.cpp index 55e475b17..e8f536818 100644 --- a/src/ripple/app/paths/Credit.cpp +++ b/src/ripple/app/paths/Credit.cpp @@ -17,7 +17,10 @@ */ //============================================================================== -#include +#include +#include +#include +#include namespace ripple { diff --git a/src/ripple/app/paths/Credit.h b/src/ripple/app/paths/Credit.h index 65b67f365..e0ba4b45e 100644 --- a/src/ripple/app/paths/Credit.h +++ b/src/ripple/app/paths/Credit.h @@ -20,6 +20,9 @@ #ifndef RIPPLED_RIPPLE_APP_PATHS_CREDIT_H #define RIPPLED_RIPPLE_APP_PATHS_CREDIT_H +#include +#include + namespace ripple { /** Calculate the maximum amount of IOUs that an account can hold diff --git a/src/ripple/app/paths/FindPaths.cpp b/src/ripple/app/paths/FindPaths.cpp index 374d6184b..4bfd254b0 100644 --- a/src/ripple/app/paths/FindPaths.cpp +++ b/src/ripple/app/paths/FindPaths.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include diff --git a/src/ripple/app/paths/FindPaths.h b/src/ripple/app/paths/FindPaths.h index dc7122973..83feebc5f 100644 --- a/src/ripple/app/paths/FindPaths.h +++ b/src/ripple/app/paths/FindPaths.h @@ -20,6 +20,8 @@ #ifndef RIPPLED_RIPPLE_APP_PATHS_FINDPATHS_H #define RIPPLED_RIPPLE_APP_PATHS_FINDPATHS_H +#include + namespace ripple { class FindPaths diff --git a/src/ripple/app/paths/Node.cpp b/src/ripple/app/paths/Node.cpp index 833a08fa1..df5cd7e6d 100644 --- a/src/ripple/app/paths/Node.cpp +++ b/src/ripple/app/paths/Node.cpp @@ -17,6 +17,10 @@ */ //============================================================================== +#include +#include +#include + namespace ripple { namespace path { diff --git a/src/ripple/app/paths/NodeDirectory.h b/src/ripple/app/paths/NodeDirectory.h index 50357dcf1..a3660786c 100644 --- a/src/ripple/app/paths/NodeDirectory.h +++ b/src/ripple/app/paths/NodeDirectory.h @@ -20,8 +20,13 @@ #ifndef RIPPLED_RIPPLE_MODULE_APP_PATHS_NODEDIRECTORY_H #define RIPPLED_RIPPLE_MODULE_APP_PATHS_NODEDIRECTORY_H +#include +#include + namespace ripple { +// VFALCO TODO de-inline these function definitions + class NodeDirectory { public: // Current directory - the last 64 bits of this are the quality. diff --git a/src/ripple/app/paths/PathRequest.cpp b/src/ripple/app/paths/PathRequest.cpp index b1f5f99bf..67870ab13 100644 --- a/src/ripple/app/paths/PathRequest.cpp +++ b/src/ripple/app/paths/PathRequest.cpp @@ -17,8 +17,14 @@ */ //============================================================================== +#include #include #include +#include +#include +#include +#include +#include #include #include #include diff --git a/src/ripple/app/paths/PathRequest.h b/src/ripple/app/paths/PathRequest.h index e33fdc4df..40a1a3243 100644 --- a/src/ripple/app/paths/PathRequest.h +++ b/src/ripple/app/paths/PathRequest.h @@ -22,6 +22,7 @@ #include #include +#include namespace ripple { diff --git a/src/ripple/app/paths/PathRequests.cpp b/src/ripple/app/paths/PathRequests.cpp index 906098879..a972452c1 100644 --- a/src/ripple/app/paths/PathRequests.cpp +++ b/src/ripple/app/paths/PathRequests.cpp @@ -17,7 +17,10 @@ */ //============================================================================== +#include #include +#include +#include #include #include #include diff --git a/src/ripple/app/paths/PathState.cpp b/src/ripple/app/paths/PathState.cpp index 74c630c50..0042929a3 100644 --- a/src/ripple/app/paths/PathState.cpp +++ b/src/ripple/app/paths/PathState.cpp @@ -17,8 +17,13 @@ */ //============================================================================== +#include #include +#include +#include #include +#include +#include namespace ripple { diff --git a/src/ripple/app/paths/PathState.h b/src/ripple/app/paths/PathState.h index a03d26feb..a76c0b072 100644 --- a/src/ripple/app/paths/PathState.h +++ b/src/ripple/app/paths/PathState.h @@ -20,6 +20,7 @@ #ifndef RIPPLE_PATHSTATE_H #define RIPPLE_PATHSTATE_H +#include #include #include diff --git a/src/ripple/app/paths/Pathfinder.cpp b/src/ripple/app/paths/Pathfinder.cpp index 323458173..7c48c928a 100644 --- a/src/ripple/app/paths/Pathfinder.cpp +++ b/src/ripple/app/paths/Pathfinder.cpp @@ -17,8 +17,14 @@ */ //============================================================================== +#include +#include #include #include +#include +#include +#include +#include #include #include #include diff --git a/src/ripple/app/paths/Pathfinder.h b/src/ripple/app/paths/Pathfinder.h index 3046a1df1..9e1871078 100644 --- a/src/ripple/app/paths/Pathfinder.h +++ b/src/ripple/app/paths/Pathfinder.h @@ -20,6 +20,12 @@ #ifndef RIPPLE_PATHFINDER_H #define RIPPLE_PATHFINDER_H +#include +#include +#include +#include +#include + namespace ripple { /** Calculates payment paths. diff --git a/src/ripple/app/paths/RippleCalc.cpp b/src/ripple/app/paths/RippleCalc.cpp index 44f09a4e3..0c2e8e71d 100644 --- a/src/ripple/app/paths/RippleCalc.cpp +++ b/src/ripple/app/paths/RippleCalc.cpp @@ -17,8 +17,10 @@ */ //============================================================================== +#include #include #include +#include namespace ripple { namespace path { diff --git a/src/ripple/app/paths/RippleCalc.h b/src/ripple/app/paths/RippleCalc.h index 89652b3fb..6ec05a7ae 100644 --- a/src/ripple/app/paths/RippleCalc.h +++ b/src/ripple/app/paths/RippleCalc.h @@ -20,6 +20,11 @@ #ifndef RIPPLE_RIPPLECALC_H #define RIPPLE_RIPPLECALC_H +#include +#include +#include +#include + namespace ripple { namespace path { diff --git a/src/ripple/app/paths/RippleLineCache.cpp b/src/ripple/app/paths/RippleLineCache.cpp index 7374518a5..b17fade39 100644 --- a/src/ripple/app/paths/RippleLineCache.cpp +++ b/src/ripple/app/paths/RippleLineCache.cpp @@ -17,6 +17,9 @@ */ //============================================================================== +#include +#include + namespace ripple { RippleLineCache::RippleLineCache (Ledger::ref l) diff --git a/src/ripple/app/paths/RippleState.cpp b/src/ripple/app/paths/RippleState.cpp index 7669a9b95..36a22d552 100644 --- a/src/ripple/app/paths/RippleState.cpp +++ b/src/ripple/app/paths/RippleState.cpp @@ -17,11 +17,19 @@ */ //============================================================================== +#include +#include +#include +#include +#include +#include // + namespace ripple { RippleState::pointer RippleState::makeItem ( Account const& accountID, STLedgerEntry::ref ledgerEntry) { + // VFALCO Does this ever happen in practice? if (!ledgerEntry || ledgerEntry->getType () != ltRIPPLE_STATE) return pointer (); diff --git a/src/ripple/app/paths/RippleState.h b/src/ripple/app/paths/RippleState.h index b4d54c5ec..6f7ebf245 100644 --- a/src/ripple/app/paths/RippleState.h +++ b/src/ripple/app/paths/RippleState.h @@ -20,6 +20,11 @@ #ifndef RIPPLE_RIPPLESTATE_H #define RIPPLE_RIPPLESTATE_H +#include +#include +#include +#include // + namespace ripple { // diff --git a/src/ripple/app/paths/cursor/AdvanceNode.cpp b/src/ripple/app/paths/cursor/AdvanceNode.cpp index f7d4063f6..df6e82449 100644 --- a/src/ripple/app/paths/cursor/AdvanceNode.cpp +++ b/src/ripple/app/paths/cursor/AdvanceNode.cpp @@ -17,7 +17,9 @@ */ //============================================================================== +#include #include +#include namespace ripple { namespace path { diff --git a/src/ripple/app/paths/cursor/DeliverNodeForward.cpp b/src/ripple/app/paths/cursor/DeliverNodeForward.cpp index 207ccfe47..702de7ff6 100644 --- a/src/ripple/app/paths/cursor/DeliverNodeForward.cpp +++ b/src/ripple/app/paths/cursor/DeliverNodeForward.cpp @@ -17,7 +17,9 @@ */ //============================================================================== +#include #include +#include namespace ripple { namespace path { diff --git a/src/ripple/app/paths/cursor/DeliverNodeReverse.cpp b/src/ripple/app/paths/cursor/DeliverNodeReverse.cpp index ba13d43c5..a29d998d7 100644 --- a/src/ripple/app/paths/cursor/DeliverNodeReverse.cpp +++ b/src/ripple/app/paths/cursor/DeliverNodeReverse.cpp @@ -17,7 +17,9 @@ */ //============================================================================== +#include #include +#include namespace ripple { namespace path { diff --git a/src/ripple/app/paths/cursor/ForwardLiquidity.cpp b/src/ripple/app/paths/cursor/ForwardLiquidity.cpp index 2d8822bc4..6ec36e3ae 100644 --- a/src/ripple/app/paths/cursor/ForwardLiquidity.cpp +++ b/src/ripple/app/paths/cursor/ForwardLiquidity.cpp @@ -17,6 +17,9 @@ */ //============================================================================== +#include +#include +#include #include namespace ripple { diff --git a/src/ripple/app/paths/cursor/ForwardLiquidityForAccount.cpp b/src/ripple/app/paths/cursor/ForwardLiquidityForAccount.cpp index 4901bed24..8b6f5bad4 100644 --- a/src/ripple/app/paths/cursor/ForwardLiquidityForAccount.cpp +++ b/src/ripple/app/paths/cursor/ForwardLiquidityForAccount.cpp @@ -17,8 +17,10 @@ */ //============================================================================== +#include #include #include +#include namespace ripple { namespace path { diff --git a/src/ripple/app/paths/cursor/Liquidity.cpp b/src/ripple/app/paths/cursor/Liquidity.cpp index e411fc203..d20a0331f 100644 --- a/src/ripple/app/paths/cursor/Liquidity.cpp +++ b/src/ripple/app/paths/cursor/Liquidity.cpp @@ -17,9 +17,10 @@ */ //============================================================================== -#include - +#include #include +#include +#include namespace ripple { namespace path { @@ -50,8 +51,9 @@ TER PathCursor::liquidity (LedgerEntrySet const& lesCheckpoint) const break; } - WriteLog (lsTRACE, RippleCalc) - << "nextIncrement: Path after reverse: " << pathState_.getJson (); + // VFALCO-FIXME this generates errors + // WriteLog (lsTRACE, RippleCalc) + // << "nextIncrement: Path after reverse: " << pathState_.getJson (); if (resultCode != tesSUCCESS) return resultCode; diff --git a/src/ripple/app/paths/cursor/NextIncrement.cpp b/src/ripple/app/paths/cursor/NextIncrement.cpp index e5272979c..c7c2a78e8 100644 --- a/src/ripple/app/paths/cursor/NextIncrement.cpp +++ b/src/ripple/app/paths/cursor/NextIncrement.cpp @@ -17,7 +17,9 @@ */ //============================================================================== +#include #include +#include namespace ripple { namespace path { @@ -36,8 +38,9 @@ void PathCursor::nextIncrement (LedgerEntrySet const& lesCheckpoint) const { // The next state is what is available in preference order. // This is calculated when referenced accounts changed. - WriteLog (lsTRACE, RippleCalc) - << "nextIncrement: Path In: " << pathState_.getJson (); + // VFALCO-FIXME this generates errors + // WriteLog (lsTRACE, RippleCalc) + // << "nextIncrement: Path In: " << pathState_.getJson (); auto status = liquidity(lesCheckpoint); @@ -57,8 +60,9 @@ void PathCursor::nextIncrement (LedgerEntrySet const& lesCheckpoint) const pathState_.setQuality(getRate ( pathState_.outPass(), pathState_.inPass())); - WriteLog (lsTRACE, RippleCalc) - << "nextIncrement: Path after forward: " << pathState_.getJson (); + // VFALCO-FIXME this generates errors + // WriteLog (lsTRACE, RippleCalc) + // << "nextIncrement: Path after forward: " << pathState_.getJson (); } else { diff --git a/src/ripple/app/paths/cursor/PathCursor.h b/src/ripple/app/paths/cursor/PathCursor.h index 0ecfea4ac..6c8b93300 100644 --- a/src/ripple/app/paths/cursor/PathCursor.h +++ b/src/ripple/app/paths/cursor/PathCursor.h @@ -20,6 +20,8 @@ #ifndef RIPPLED_RIPPLE_MODULE_APP_PATHS_PATHCURSOR_H #define RIPPLED_RIPPLE_MODULE_APP_PATHS_PATHCURSOR_H +#include + namespace ripple { namespace path { diff --git a/src/ripple/app/paths/cursor/ReverseLiquidity.cpp b/src/ripple/app/paths/cursor/ReverseLiquidity.cpp index 73fa506c0..c16f53940 100644 --- a/src/ripple/app/paths/cursor/ReverseLiquidity.cpp +++ b/src/ripple/app/paths/cursor/ReverseLiquidity.cpp @@ -17,6 +17,9 @@ */ //============================================================================== +#include +#include +#include #include namespace ripple { diff --git a/src/ripple/app/paths/cursor/ReverseLiquidityForAccount.cpp b/src/ripple/app/paths/cursor/ReverseLiquidityForAccount.cpp index d458980d1..0a9c7c09c 100644 --- a/src/ripple/app/paths/cursor/ReverseLiquidityForAccount.cpp +++ b/src/ripple/app/paths/cursor/ReverseLiquidityForAccount.cpp @@ -17,9 +17,11 @@ */ //============================================================================== +#include #include #include #include +#include namespace ripple { namespace path { @@ -151,7 +153,8 @@ TER PathCursor::reverseLiquidityForAccount () const << " node.saRevIssue:" << node().saRevIssue << " saNxtOwed:" << saNxtOwed; - WriteLog (lsTRACE, RippleCalc) << pathState_.getJson (); + // VFALCO-FIXME this generates errors + //WriteLog (lsTRACE, RippleCalc) << pathState_.getJson (); // Current redeem req can't be more than IOUs on hand. assert (!node().saRevRedeem || -saNxtOwed >= node().saRevRedeem); diff --git a/src/ripple/app/paths/cursor/RippleLiquidity.cpp b/src/ripple/app/paths/cursor/RippleLiquidity.cpp index 1969c72f5..c5491e240 100644 --- a/src/ripple/app/paths/cursor/RippleLiquidity.cpp +++ b/src/ripple/app/paths/cursor/RippleLiquidity.cpp @@ -17,7 +17,10 @@ */ //============================================================================== +#include +#include #include +#include namespace ripple { namespace path { diff --git a/src/ripple/app/peers/PeerSet.cpp b/src/ripple/app/peers/PeerSet.cpp index 47f35a78e..d3edca127 100644 --- a/src/ripple/app/peers/PeerSet.cpp +++ b/src/ripple/app/peers/PeerSet.cpp @@ -17,6 +17,10 @@ */ //============================================================================== +#include +#include +#include +#include #include #include diff --git a/src/ripple/app/peers/PeerSet.h b/src/ripple/app/peers/PeerSet.h index 8a69655df..ab3de7f44 100644 --- a/src/ripple/app/peers/PeerSet.h +++ b/src/ripple/app/peers/PeerSet.h @@ -20,7 +20,12 @@ #ifndef RIPPLE_PEERSET_H #define RIPPLE_PEERSET_H +#include +#include #include +#include +#include +#include #include namespace ripple { diff --git a/src/ripple/app/peers/UniqueNodeList.cpp b/src/ripple/app/peers/UniqueNodeList.cpp index 2ac3901c3..74e408bb6 100644 --- a/src/ripple/app/peers/UniqueNodeList.cpp +++ b/src/ripple/app/peers/UniqueNodeList.cpp @@ -17,6 +17,16 @@ */ //============================================================================== +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include diff --git a/src/ripple/app/transactors/AddWallet.cpp b/src/ripple/app/transactors/AddWallet.cpp index 8276983ef..7e746b7e3 100644 --- a/src/ripple/app/transactors/AddWallet.cpp +++ b/src/ripple/app/transactors/AddWallet.cpp @@ -17,6 +17,12 @@ */ //============================================================================== +#include +#include +#include +#include +#include + namespace ripple { class AddWallet diff --git a/src/ripple/app/transactors/CancelOffer.cpp b/src/ripple/app/transactors/CancelOffer.cpp index 56f7d0d0d..7f60edace 100644 --- a/src/ripple/app/transactors/CancelOffer.cpp +++ b/src/ripple/app/transactors/CancelOffer.cpp @@ -17,6 +17,12 @@ */ //============================================================================== +#include +#include +#include +#include +#include + namespace ripple { class CancelOffer diff --git a/src/ripple/app/transactors/CancelTicket.cpp b/src/ripple/app/transactors/CancelTicket.cpp index 55889373f..6602a9f0f 100644 --- a/src/ripple/app/transactors/CancelTicket.cpp +++ b/src/ripple/app/transactors/CancelTicket.cpp @@ -17,6 +17,11 @@ */ //============================================================================== +#include +#include +#include +#include + namespace ripple { class CancelTicket diff --git a/src/ripple/app/transactors/Change.cpp b/src/ripple/app/transactors/Change.cpp index 7d04e57df..624c75c33 100644 --- a/src/ripple/app/transactors/Change.cpp +++ b/src/ripple/app/transactors/Change.cpp @@ -17,7 +17,13 @@ */ //============================================================================== +#include +#include +#include +#include +#include #include +#include namespace ripple { @@ -148,8 +154,9 @@ private: if (!feeObject) feeObject = mEngine->entryCreate (ltFEE_SETTINGS, index); - m_journal.trace << - "Previous fee object: " << feeObject->getJson (0); + // VFALCO-FIXME this generates errors + // m_journal.trace << + // "Previous fee object: " << feeObject->getJson (0); feeObject->setFieldU64 ( sfBaseFee, mTxn.getFieldU64 (sfBaseFee)); @@ -162,8 +169,9 @@ private: mEngine->entryModify (feeObject); - m_journal.trace << - "New fee object: " << feeObject->getJson (0); + // VFALCO-FIXME this generates errors + // 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 444d802ec..bea3c5aa9 100644 --- a/src/ripple/app/transactors/CreateOffer.cpp +++ b/src/ripple/app/transactors/CreateOffer.cpp @@ -17,575 +17,537 @@ */ //============================================================================== +#include #include #include #include #include +#include +#include #include - #include namespace ripple { -class CreateOffer - : public Transactor +TER +CreateOffer::checkAcceptAsset(IssueRef issue) const { -private: - // What kind of offer we are placing -#if RIPPLE_ENABLE_AUTOBRIDGING - bool autobridging_; -#endif + /* Only valid for custom currencies */ + assert (!isXRP (issue.currency)); - /** Determine if we are authorized to hold the asset we want to get */ - TER - checkAcceptAsset(IssueRef issue) const + SLE::pointer const issuerAccount = mEngine->entryCache ( + ltACCOUNT_ROOT, getAccountRootIndex (issue.account)); + + if (!issuerAccount) { - /* Only valid for custom currencies */ - assert (!isXRP (issue.currency)); + if (m_journal.warning) m_journal.warning << + "delay: can't receive IOUs from non-existent issuer: " << + to_string (issue.account); - SLE::pointer const issuerAccount = mEngine->entryCache ( - ltACCOUNT_ROOT, getAccountRootIndex (issue.account)); + return (mParams & tapRETRY) + ? terNO_ACCOUNT + : tecNO_ISSUER; + } - if (!issuerAccount) + if (issuerAccount->getFieldU32 (sfFlags) & lsfRequireAuth) + { + SLE::pointer const trustLine (mEngine->entryCache ( + ltRIPPLE_STATE, getRippleStateIndex ( + mTxnAccountID, issue.account, issue.currency))); + + if (!trustLine) { - if (m_journal.warning) m_journal.warning << - "delay: can't receive IOUs from non-existent issuer: " << - to_string (issue.account); + return (mParams & tapRETRY) + ? terNO_LINE + : tecNO_LINE; + } + + // Entries have a canonical representation, determined by a + // lexicographical "greater than" comparison employing strict weak + // ordering. Determine which entry we need to access. + bool const canonical_gt (mTxnAccountID > issue.account); + + bool const is_authorized (trustLine->getFieldU32 (sfFlags) & + (canonical_gt ? lsfLowAuth : lsfHighAuth)); + + if (!is_authorized) + { + if (m_journal.debug) m_journal.debug << + "delay: can't receive IOUs from issuer without auth."; return (mParams & tapRETRY) - ? terNO_ACCOUNT - : tecNO_ISSUER; + ? terNO_AUTH + : tecNO_AUTH; } - - if (issuerAccount->getFieldU32 (sfFlags) & lsfRequireAuth) - { - SLE::pointer const trustLine (mEngine->entryCache ( - ltRIPPLE_STATE, getRippleStateIndex ( - mTxnAccountID, issue.account, issue.currency))); - - if (!trustLine) - { - return (mParams & tapRETRY) - ? terNO_LINE - : tecNO_LINE; - } - - // Entries have a canonical representation, determined by a - // lexicographical "greater than" comparison employing strict weak - // ordering. Determine which entry we need to access. - bool const canonical_gt (mTxnAccountID > issue.account); - - bool const is_authorized (trustLine->getFieldU32 (sfFlags) & - (canonical_gt ? lsfLowAuth : lsfHighAuth)); - - if (!is_authorized) - { - if (m_journal.debug) m_journal.debug << - "delay: can't receive IOUs from issuer without auth."; - - return (mParams & tapRETRY) - ? terNO_AUTH - : tecNO_AUTH; - } - } - - return tesSUCCESS; } - /** Fill offer as much as possible by consuming offers already on the books. - We adjusts account balances and charges fees on top to taker. + return tesSUCCESS; +} - @param taker_amount.in How much the taker offers - @param taker_amount.out How much the taker wants - - @return result.first crossing operation success/failure indicator. - result.second amount of offer left unfilled - only meaningful - if result.first is tesSUCCESS. - */ - /** @{ */ - std::pair crossOffersBridged ( - core::LedgerView& view, - core::Amounts const& taker_amount); - - std::pair crossOffersDirect ( - core::LedgerView& view, - core::Amounts const& taker_amount); - - std::pair crossOffers ( - core::LedgerView& view, - core::Amounts const& taker_amount) - { +std::pair +CreateOffer::crossOffers (core::LedgerView& view, + core::Amounts const& taker_amount) +{ #if RIPPLE_ENABLE_AUTOBRIDGING - if (autobridging_) - return crossOffersBridged (view, taker_amount); + if (autobridging_) + return crossOffersBridged (view, taker_amount); #endif - return crossOffersDirect (view, taker_amount); - } - /** @} */ + return crossOffersDirect (view, taker_amount); +} -public: - CreateOffer ( - bool autobridging, - STTx const& txn, - TransactionEngineParams params, - TransactionEngine* engine) - : Transactor ( - txn, - params, - engine, - deprecatedLogs().journal("CreateOffer")) +CreateOffer::CreateOffer (bool autobridging, STTx const& txn, + TransactionEngineParams params, TransactionEngine* engine) + : Transactor (txn, params, engine, deprecatedLogs().journal("CreateOffer")) #if RIPPLE_ENABLE_AUTOBRIDGING , autobridging_ (autobridging) #endif - { +{ +} +TER +CreateOffer::doApply() +{ + if (m_journal.debug) m_journal.debug << + "OfferCreate> " << mTxn.getJson (0); + + std::uint32_t const uTxFlags = mTxn.getFlags (); + + bool const bPassive (uTxFlags & tfPassive); + bool const bImmediateOrCancel (uTxFlags & tfImmediateOrCancel); + bool const bFillOrKill (uTxFlags & tfFillOrKill); + bool const bSell (uTxFlags & tfSell); + + STAmount saTakerPays = mTxn.getFieldAmount (sfTakerPays); + STAmount saTakerGets = mTxn.getFieldAmount (sfTakerGets); + + if (!isLegalNet (saTakerPays) || !isLegalNet (saTakerGets)) + return temBAD_AMOUNT; + + auto const& uPaysIssuerID = saTakerPays.getIssuer (); + auto const& uPaysCurrency = saTakerPays.getCurrency (); + + auto const& uGetsIssuerID = saTakerGets.getIssuer (); + auto const& uGetsCurrency = saTakerGets.getCurrency (); + + bool const bHaveExpiration (mTxn.isFieldPresent (sfExpiration)); + bool const bHaveCancel (mTxn.isFieldPresent (sfOfferSequence)); + + std::uint32_t const uExpiration = mTxn.getFieldU32 (sfExpiration); + std::uint32_t const uCancelSequence = mTxn.getFieldU32 (sfOfferSequence); + + // FIXME understand why we use SequenceNext instead of current transaction + // sequence to determine the transaction. Why is the offer seuqnce + // number insufficient? + + std::uint32_t const uAccountSequenceNext = mTxnAccount->getFieldU32 (sfSequence); + std::uint32_t const uSequence = mTxn.getSequence (); + + const uint256 uLedgerIndex = getOfferIndex (mTxnAccountID, uSequence); + + if (m_journal.debug) + { + m_journal.debug << + "Creating offer node: " << to_string (uLedgerIndex) << + " uSequence=" << uSequence; + + if (bImmediateOrCancel) + m_journal.debug << "Transaction: IoC set."; + + if (bFillOrKill) + m_journal.debug << "Transaction: FoK set."; } - TER - doApply () override + // This is the original rate of this offer, and is the rate at which it will + // be placed, even if crossing offers change the amounts. + std::uint64_t const uRate = getRate (saTakerGets, saTakerPays); + + TER terResult (tesSUCCESS); + + // This is the ledger view that we work against. Transactions are applied + // as we go on processing transactions. + core::LedgerView& view (mEngine->view ()); + + // This is a checkpoint with just the fees paid. If something goes wrong + // with this transaction, we roll back to this ledger. + core::LedgerView view_checkpoint (view); + + view.bumpSeq (); // Begin ledger variance. + + SLE::pointer sleCreator = mEngine->entryCache ( + ltACCOUNT_ROOT, getAccountRootIndex (mTxnAccountID)); + + if (uTxFlags & tfOfferCreateMask) { if (m_journal.debug) m_journal.debug << - "OfferCreate> " << mTxn.getJson (0); - - std::uint32_t const uTxFlags = mTxn.getFlags (); - - bool const bPassive (uTxFlags & tfPassive); - bool const bImmediateOrCancel (uTxFlags & tfImmediateOrCancel); - bool const bFillOrKill (uTxFlags & tfFillOrKill); - bool const bSell (uTxFlags & tfSell); - - STAmount saTakerPays = mTxn.getFieldAmount (sfTakerPays); - STAmount saTakerGets = mTxn.getFieldAmount (sfTakerGets); - - if (!isLegalNet (saTakerPays) || !isLegalNet (saTakerGets)) - return temBAD_AMOUNT; - - auto const& uPaysIssuerID = saTakerPays.getIssuer (); - auto const& uPaysCurrency = saTakerPays.getCurrency (); - - auto const& uGetsIssuerID = saTakerGets.getIssuer (); - auto const& uGetsCurrency = saTakerGets.getCurrency (); - - bool const bHaveExpiration (mTxn.isFieldPresent (sfExpiration)); - bool const bHaveCancel (mTxn.isFieldPresent (sfOfferSequence)); - - std::uint32_t const uExpiration = mTxn.getFieldU32 (sfExpiration); - std::uint32_t const uCancelSequence = mTxn.getFieldU32 (sfOfferSequence); - - // FIXME understand why we use SequenceNext instead of current transaction - // sequence to determine the transaction. Why is the offer seuqnce - // number insufficient? - - std::uint32_t const uAccountSequenceNext = mTxnAccount->getFieldU32 (sfSequence); - std::uint32_t const uSequence = mTxn.getSequence (); - - const uint256 uLedgerIndex = getOfferIndex (mTxnAccountID, uSequence); - - if (m_journal.debug) - { - m_journal.debug << - "Creating offer node: " << to_string (uLedgerIndex) << - " uSequence=" << uSequence; - - if (bImmediateOrCancel) - m_journal.debug << "Transaction: IoC set."; - - if (bFillOrKill) - m_journal.debug << "Transaction: FoK set."; - } - - // This is the original rate of this offer, and is the rate at which it will - // be placed, even if crossing offers change the amounts. - std::uint64_t const uRate = getRate (saTakerGets, saTakerPays); - - TER terResult (tesSUCCESS); - - // This is the ledger view that we work against. Transactions are applied - // as we go on processing transactions. - core::LedgerView& view (mEngine->view ()); - - // This is a checkpoint with just the fees paid. If something goes wrong - // with this transaction, we roll back to this ledger. - core::LedgerView view_checkpoint (view); - - view.bumpSeq (); // Begin ledger variance. - - SLE::pointer sleCreator = mEngine->entryCache ( - ltACCOUNT_ROOT, getAccountRootIndex (mTxnAccountID)); - - if (uTxFlags & tfOfferCreateMask) - { - if (m_journal.debug) m_journal.debug << - "Malformed transaction: Invalid flags set."; - - terResult = temINVALID_FLAG; - } - else if (bImmediateOrCancel && bFillOrKill) - { - if (m_journal.debug) m_journal.debug << - "Malformed transaction: both IoC and FoK set."; - - terResult = temINVALID_FLAG; - } - else if (bHaveExpiration && !uExpiration) - { - m_journal.warning << - "Malformed offer: bad expiration"; - - terResult = temBAD_EXPIRATION; - } - else if (saTakerPays.isNative () && saTakerGets.isNative ()) - { - m_journal.warning << - "Malformed offer: XRP for XRP"; - - terResult = temBAD_OFFER; - } - else if (saTakerPays <= zero || saTakerGets <= zero) - { - m_journal.warning << - "Malformed offer: bad amount"; - - terResult = temBAD_OFFER; - } - else if (uPaysCurrency == uGetsCurrency && uPaysIssuerID == uGetsIssuerID) - { - m_journal.warning << - "Malformed offer: redundant offer"; - - terResult = temREDUNDANT; - } - // We don't allow a non-native currency to use the currency code XRP. - else if (badCurrency() == uPaysCurrency || badCurrency() == uGetsCurrency) - { - m_journal.warning << - "Malformed offer: Bad currency."; - - terResult = temBAD_CURRENCY; - } - else if (saTakerPays.isNative () != !uPaysIssuerID || - saTakerGets.isNative () != !uGetsIssuerID) - { - m_journal.warning << - "Malformed offer: bad issuer"; - - terResult = temBAD_ISSUER; - } - else if (view.isGlobalFrozen (uPaysIssuerID) || view.isGlobalFrozen (uGetsIssuerID)) - { - m_journal.warning << - "Offer involves frozen asset"; - - terResult = tecFROZEN; - } - else if (view.accountFunds ( - mTxnAccountID, saTakerGets, fhZERO_IF_FROZEN) <= zero) - { - m_journal.warning << - "delay: Offers must be at least partially funded."; - - terResult = tecUNFUNDED_OFFER; - } - // This can probably be simplified to make sure that you cancel sequences - // before the transaction sequence number. - else if (bHaveCancel && (!uCancelSequence || uAccountSequenceNext - 1 <= uCancelSequence)) - { - if (m_journal.debug) m_journal.debug << - "uAccountSequenceNext=" << uAccountSequenceNext << - " uOfferSequence=" << uCancelSequence; - - terResult = temBAD_SEQUENCE; - } - - if (terResult != tesSUCCESS) - { - if (m_journal.debug) m_journal.debug << - "final terResult=" << transToken (terResult); - - return terResult; - } - - // Process a cancellation request that's passed along with an offer. - if ((terResult == tesSUCCESS) && bHaveCancel) - { - uint256 const uCancelIndex ( - getOfferIndex (mTxnAccountID, uCancelSequence)); - SLE::pointer sleCancel = mEngine->entryCache (ltOFFER, uCancelIndex); - - // It's not an error to not find the offer to cancel: it might have - // been consumed or removed as we are processing. - if (sleCancel) - { - m_journal.warning << - "Cancelling order with sequence " << uCancelSequence; - - terResult = view.offerDelete (sleCancel); - } - } - - // Expiration is defined in terms of the close time of the parent ledger, - // because we definitively know the time that it closed but we do not - // know the closing time of the ledger that is under construction. - if (bHaveExpiration && - (mEngine->getLedger ()->getParentCloseTimeNC () >= uExpiration)) - { - return tesSUCCESS; - } - - // Make sure that we are authorized to hold what the taker will pay us. - if (terResult == tesSUCCESS && !saTakerPays.isNative ()) - terResult = checkAcceptAsset (Issue (uPaysCurrency, uPaysIssuerID)); - - bool crossed = false; - bool const bOpenLedger (mParams & tapOPEN_LEDGER); - - if (terResult == tesSUCCESS) - { - // We reverse gets and pays because during offer crossing we are taking. - core::Amounts const taker_amount (saTakerGets, saTakerPays); - - // The amount of the offer that we will need to place, after we finish - // offer crossing processing. It may be equal to the original amount, - // empty (fully crossed), or something in-between. - core::Amounts place_offer; - - std::tie(terResult, place_offer) = crossOffers (view, taker_amount); - - if (terResult == tecFAILED_PROCESSING && bOpenLedger) - terResult = telFAILED_PROCESSING; - - if (terResult == tesSUCCESS) - { - // We now need to reduce the offer by the cross flow. We reverse - // in and out here, since during crossing we were takers. - assert (saTakerPays.getCurrency () == place_offer.out.getCurrency ()); - assert (saTakerPays.getIssuer () == place_offer.out.getIssuer ()); - assert (saTakerGets.getCurrency () == place_offer.in.getCurrency ()); - assert (saTakerGets.getIssuer () == place_offer.in.getIssuer ()); - - if (taker_amount != place_offer) - crossed = true; - - if (m_journal.debug) - { - m_journal.debug << "Offer Crossing: " << transToken (terResult); - - if (terResult == tesSUCCESS) - { - m_journal.debug << - " takerPays: " << saTakerPays.getFullText () << - " -> " << place_offer.out.getFullText (); - m_journal.debug << - " takerGets: " << saTakerGets.getFullText () << - " -> " << place_offer.in.getFullText (); - } - } - - saTakerPays = place_offer.out; - saTakerGets = place_offer.in; - } - } - - if (terResult != tesSUCCESS) - { - m_journal.debug << - "final terResult=" << transToken (terResult); - - return terResult; - } - - if (m_journal.debug) - { - m_journal.debug << - "takeOffers: saTakerPays=" < " << saTakerGets.getHumanCurrency () << - "/" << to_string (saTakerGets.getIssuer ()); - - // We use the original rate to place the offer. - uDirectory = getQualityIndex (uBookBase, uRate); - - // Add offer to order book. - terResult = view.dirAdd (uBookNode, uDirectory, uLedgerIndex, - std::bind ( - &Ledger::qualityDirDescriber, std::placeholders::_1, - std::placeholders::_2, saTakerPays.getCurrency (), - uPaysIssuerID, saTakerGets.getCurrency (), - uGetsIssuerID, uRate)); - } - - if (tesSUCCESS == terResult) - { - if (m_journal.debug) - { - m_journal.debug << - "sfAccount=" << - to_string (mTxnAccountID); - m_journal.debug << - "uPaysIssuerID=" << - to_string (uPaysIssuerID); - m_journal.debug << - "uGetsIssuerID=" << - to_string (uGetsIssuerID); - m_journal.debug << - "saTakerPays.isNative()=" << - saTakerPays.isNative (); - m_journal.debug << - "saTakerGets.isNative()=" << - saTakerGets.isNative (); - m_journal.debug << - "uPaysCurrency=" << - saTakerPays.getHumanCurrency (); - m_journal.debug << - "uGetsCurrency=" << - saTakerGets.getHumanCurrency (); - } - - SLE::pointer sleOffer (mEngine->entryCreate (ltOFFER, uLedgerIndex)); - - sleOffer->setFieldAccount (sfAccount, mTxnAccountID); - sleOffer->setFieldU32 (sfSequence, uSequence); - sleOffer->setFieldH256 (sfBookDirectory, uDirectory); - sleOffer->setFieldAmount (sfTakerPays, saTakerPays); - sleOffer->setFieldAmount (sfTakerGets, saTakerGets); - sleOffer->setFieldU64 (sfOwnerNode, uOwnerNode); - sleOffer->setFieldU64 (sfBookNode, uBookNode); - - if (uExpiration) - sleOffer->setFieldU32 (sfExpiration, uExpiration); - - if (bPassive) - sleOffer->setFlag (lsfPassive); - - if (bSell) - sleOffer->setFlag (lsfSell); - - if (m_journal.debug) m_journal.debug << - "final terResult=" << transToken (terResult) << - " sleOffer=" << sleOffer->getJson (0); - } - } - - if (terResult != tesSUCCESS) - { - m_journal.debug << - "final terResult=" << transToken (terResult); - } + "Malformed transaction: Invalid flags set."; + + terResult = temINVALID_FLAG; + } + else if (bImmediateOrCancel && bFillOrKill) + { + if (m_journal.debug) m_journal.debug << + "Malformed transaction: both IoC and FoK set."; + + terResult = temINVALID_FLAG; + } + else if (bHaveExpiration && !uExpiration) + { + m_journal.warning << + "Malformed offer: bad expiration"; + + terResult = temBAD_EXPIRATION; + } + else if (saTakerPays.isNative () && saTakerGets.isNative ()) + { + m_journal.warning << + "Malformed offer: XRP for XRP"; + + terResult = temBAD_OFFER; + } + else if (saTakerPays <= zero || saTakerGets <= zero) + { + m_journal.warning << + "Malformed offer: bad amount"; + + terResult = temBAD_OFFER; + } + else if (uPaysCurrency == uGetsCurrency && uPaysIssuerID == uGetsIssuerID) + { + m_journal.warning << + "Malformed offer: redundant offer"; + + terResult = temREDUNDANT; + } + // We don't allow a non-native currency to use the currency code XRP. + else if (badCurrency() == uPaysCurrency || badCurrency() == uGetsCurrency) + { + m_journal.warning << + "Malformed offer: Bad currency."; + + terResult = temBAD_CURRENCY; + } + else if (saTakerPays.isNative () != !uPaysIssuerID || + saTakerGets.isNative () != !uGetsIssuerID) + { + m_journal.warning << + "Malformed offer: bad issuer"; + + terResult = temBAD_ISSUER; + } + else if (view.isGlobalFrozen (uPaysIssuerID) || view.isGlobalFrozen (uGetsIssuerID)) + { + m_journal.warning << + "Offer involves frozen asset"; + + terResult = tecFROZEN; + } + else if (view.accountFunds ( + mTxnAccountID, saTakerGets, fhZERO_IF_FROZEN) <= zero) + { + m_journal.warning << + "delay: Offers must be at least partially funded."; + + terResult = tecUNFUNDED_OFFER; + } + // This can probably be simplified to make sure that you cancel sequences + // before the transaction sequence number. + else if (bHaveCancel && (!uCancelSequence || uAccountSequenceNext - 1 <= uCancelSequence)) + { + if (m_journal.debug) m_journal.debug << + "uAccountSequenceNext=" << uAccountSequenceNext << + " uOfferSequence=" << uCancelSequence; + + terResult = temBAD_SEQUENCE; + } + + if (terResult != tesSUCCESS) + { + if (m_journal.debug) m_journal.debug << + "final terResult=" << transToken (terResult); return terResult; } -}; + + // Process a cancellation request that's passed along with an offer. + if ((terResult == tesSUCCESS) && bHaveCancel) + { + uint256 const uCancelIndex ( + getOfferIndex (mTxnAccountID, uCancelSequence)); + SLE::pointer sleCancel = mEngine->entryCache (ltOFFER, uCancelIndex); + + // It's not an error to not find the offer to cancel: it might have + // been consumed or removed as we are processing. + if (sleCancel) + { + m_journal.warning << + "Cancelling order with sequence " << uCancelSequence; + + terResult = view.offerDelete (sleCancel); + } + } + + // Expiration is defined in terms of the close time of the parent ledger, + // because we definitively know the time that it closed but we do not + // know the closing time of the ledger that is under construction. + if (bHaveExpiration && + (mEngine->getLedger ()->getParentCloseTimeNC () >= uExpiration)) + { + return tesSUCCESS; + } + + // Make sure that we are authorized to hold what the taker will pay us. + if (terResult == tesSUCCESS && !saTakerPays.isNative ()) + terResult = checkAcceptAsset (Issue (uPaysCurrency, uPaysIssuerID)); + + bool crossed = false; + bool const bOpenLedger (mParams & tapOPEN_LEDGER); + + if (terResult == tesSUCCESS) + { + // We reverse gets and pays because during offer crossing we are taking. + core::Amounts const taker_amount (saTakerGets, saTakerPays); + + // The amount of the offer that we will need to place, after we finish + // offer crossing processing. It may be equal to the original amount, + // empty (fully crossed), or something in-between. + core::Amounts place_offer; + + std::tie(terResult, place_offer) = crossOffers (view, taker_amount); + + if (terResult == tecFAILED_PROCESSING && bOpenLedger) + terResult = telFAILED_PROCESSING; + + if (terResult == tesSUCCESS) + { + // We now need to reduce the offer by the cross flow. We reverse + // in and out here, since during crossing we were takers. + assert (saTakerPays.getCurrency () == place_offer.out.getCurrency ()); + assert (saTakerPays.getIssuer () == place_offer.out.getIssuer ()); + assert (saTakerGets.getCurrency () == place_offer.in.getCurrency ()); + assert (saTakerGets.getIssuer () == place_offer.in.getIssuer ()); + + if (taker_amount != place_offer) + crossed = true; + + if (m_journal.debug) + { + m_journal.debug << "Offer Crossing: " << transToken (terResult); + + if (terResult == tesSUCCESS) + { + m_journal.debug << + " takerPays: " << saTakerPays.getFullText () << + " -> " << place_offer.out.getFullText (); + m_journal.debug << + " takerGets: " << saTakerGets.getFullText () << + " -> " << place_offer.in.getFullText (); + } + } + + saTakerPays = place_offer.out; + saTakerGets = place_offer.in; + } + } + + if (terResult != tesSUCCESS) + { + m_journal.debug << + "final terResult=" << transToken (terResult); + + return terResult; + } + + if (m_journal.debug) + { + m_journal.debug << + "takeOffers: saTakerPays=" < " << saTakerGets.getHumanCurrency () << + "/" << to_string (saTakerGets.getIssuer ()); + + // We use the original rate to place the offer. + uDirectory = getQualityIndex (uBookBase, uRate); + + // Add offer to order book. + terResult = view.dirAdd (uBookNode, uDirectory, uLedgerIndex, + std::bind ( + &Ledger::qualityDirDescriber, std::placeholders::_1, + std::placeholders::_2, saTakerPays.getCurrency (), + uPaysIssuerID, saTakerGets.getCurrency (), + uGetsIssuerID, uRate)); + } + + if (tesSUCCESS == terResult) + { + if (m_journal.debug) + { + m_journal.debug << + "sfAccount=" << + to_string (mTxnAccountID); + m_journal.debug << + "uPaysIssuerID=" << + to_string (uPaysIssuerID); + m_journal.debug << + "uGetsIssuerID=" << + to_string (uGetsIssuerID); + m_journal.debug << + "saTakerPays.isNative()=" << + saTakerPays.isNative (); + m_journal.debug << + "saTakerGets.isNative()=" << + saTakerGets.isNative (); + m_journal.debug << + "uPaysCurrency=" << + saTakerPays.getHumanCurrency (); + m_journal.debug << + "uGetsCurrency=" << + saTakerGets.getHumanCurrency (); + } + + SLE::pointer sleOffer (mEngine->entryCreate (ltOFFER, uLedgerIndex)); + + sleOffer->setFieldAccount (sfAccount, mTxnAccountID); + sleOffer->setFieldU32 (sfSequence, uSequence); + sleOffer->setFieldH256 (sfBookDirectory, uDirectory); + sleOffer->setFieldAmount (sfTakerPays, saTakerPays); + sleOffer->setFieldAmount (sfTakerGets, saTakerGets); + sleOffer->setFieldU64 (sfOwnerNode, uOwnerNode); + sleOffer->setFieldU64 (sfBookNode, uBookNode); + + if (uExpiration) + sleOffer->setFieldU32 (sfExpiration, uExpiration); + + if (bPassive) + sleOffer->setFlag (lsfPassive); + + if (bSell) + sleOffer->setFlag (lsfSell); + + if (m_journal.debug) m_journal.debug << + "final terResult=" << transToken (terResult) << + " sleOffer=" << sleOffer->getJson (0); + } + } + + if (terResult != tesSUCCESS) + { + m_journal.debug << + "final terResult=" << transToken (terResult); + } + + return terResult; +} + +//------------------------------------------------------------------------------ TER -transact_CreateOffer ( - STTx const& txn, - TransactionEngineParams params, - TransactionEngine* engine) +transact_CreateOffer (STTx const& txn, + TransactionEngineParams params, TransactionEngine* engine) { // Autobridging is performed only when the offer does not involve XRP bool autobridging = diff --git a/src/ripple/app/transactors/CreateOffer.h b/src/ripple/app/transactors/CreateOffer.h new file mode 100644 index 000000000..e51aaf7a1 --- /dev/null +++ b/src/ripple/app/transactors/CreateOffer.h @@ -0,0 +1,83 @@ +//------------------------------------------------------------------------------ +/* + This file is part of rippled: https://github.com/ripple/rippled + Copyright (c) 2012, 2013 Ripple Labs Inc. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ +//============================================================================== + +#ifndef RIPPLE_APP_CREATEOFFER_H_INCLUDED +#define RIPPLE_APP_CREATEOFFER_H_INCLUDED + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace ripple { + +class CreateOffer + : public Transactor +{ +private: + // What kind of offer we are placing +#if RIPPLE_ENABLE_AUTOBRIDGING + bool autobridging_; +#endif + + // Determine if we are authorized to hold the asset we want to get + TER + checkAcceptAsset(IssueRef issue) const; + + /* Fill offer as much as possible by consuming offers already on the books. + We adjusts account balances and charges fees on top to taker. + + @param taker_amount.in How much the taker offers + @param taker_amount.out How much the taker wants + + @return result.first crossing operation success/failure indicator. + result.second amount of offer left unfilled - only meaningful + if result.first is tesSUCCESS. + */ + std::pair + crossOffersBridged (core::LedgerView& view, + core::Amounts const& taker_amount); + + std::pair + crossOffersDirect (core::LedgerView& view, + core::Amounts const& taker_amount); + + std::pair + crossOffers (core::LedgerView& view, + core::Amounts const& taker_amount); + +public: + CreateOffer (bool autobridging, STTx const& txn, + TransactionEngineParams params, TransactionEngine* engine); + + TER + doApply() override; +}; + +TER +transact_CreateOffer (STTx const& txn, + TransactionEngineParams params, TransactionEngine* engine); + +} + +#endif diff --git a/src/ripple/app/transactors/CreateOfferBridged.cpp b/src/ripple/app/transactors/CreateOfferBridged.cpp index 62c786a61..06cc24bd0 100644 --- a/src/ripple/app/transactors/CreateOfferBridged.cpp +++ b/src/ripple/app/transactors/CreateOfferBridged.cpp @@ -17,9 +17,11 @@ */ //============================================================================== +#include #include #include #include +#include #include namespace ripple { diff --git a/src/ripple/app/transactors/CreateOfferDirect.cpp b/src/ripple/app/transactors/CreateOfferDirect.cpp index f1eda6bb6..3b44dd9a2 100644 --- a/src/ripple/app/transactors/CreateOfferDirect.cpp +++ b/src/ripple/app/transactors/CreateOfferDirect.cpp @@ -17,8 +17,10 @@ */ //============================================================================== +#include #include #include +#include #include namespace ripple { diff --git a/src/ripple/app/transactors/CreateTicket.cpp b/src/ripple/app/transactors/CreateTicket.cpp index 30d61580e..4445d908c 100644 --- a/src/ripple/app/transactors/CreateTicket.cpp +++ b/src/ripple/app/transactors/CreateTicket.cpp @@ -17,6 +17,11 @@ */ //============================================================================== +#include +#include +#include +#include + namespace ripple { class CreateTicket diff --git a/src/ripple/app/transactors/Payment.cpp b/src/ripple/app/transactors/Payment.cpp index 9e7dd6fdd..514e9de4b 100644 --- a/src/ripple/app/transactors/Payment.cpp +++ b/src/ripple/app/transactors/Payment.cpp @@ -17,6 +17,12 @@ */ //============================================================================== +#include +#include +#include +#include +#include + namespace ripple { // See https://ripple.com/wiki/Transaction_Format#Payment_.280.29 diff --git a/src/ripple/app/transactors/SetAccount.cpp b/src/ripple/app/transactors/SetAccount.cpp index f04634a49..85337a85e 100644 --- a/src/ripple/app/transactors/SetAccount.cpp +++ b/src/ripple/app/transactors/SetAccount.cpp @@ -17,7 +17,13 @@ */ //============================================================================== +#include +#include +#include +#include #include +#include +#include namespace ripple { diff --git a/src/ripple/app/transactors/SetRegularKey.cpp b/src/ripple/app/transactors/SetRegularKey.cpp index 97a98d536..5f2d53d99 100644 --- a/src/ripple/app/transactors/SetRegularKey.cpp +++ b/src/ripple/app/transactors/SetRegularKey.cpp @@ -17,6 +17,11 @@ */ //============================================================================== +#include +#include +#include +#include + namespace ripple { class SetRegularKey diff --git a/src/ripple/app/transactors/SetTrust.cpp b/src/ripple/app/transactors/SetTrust.cpp index cdc499c93..bb751082b 100644 --- a/src/ripple/app/transactors/SetTrust.cpp +++ b/src/ripple/app/transactors/SetTrust.cpp @@ -17,6 +17,13 @@ */ //============================================================================== +#include +#include +#include +#include +#include +#include + namespace ripple { class SetTrust diff --git a/src/ripple/app/transactors/Transactor.cpp b/src/ripple/app/transactors/Transactor.cpp index 1e4fee0c9..e7cf9d210 100644 --- a/src/ripple/app/transactors/Transactor.cpp +++ b/src/ripple/app/transactors/Transactor.cpp @@ -17,8 +17,10 @@ */ //============================================================================== +#include #include #include +#include namespace ripple { diff --git a/src/ripple/app/transactors/Transactor.h b/src/ripple/app/transactors/Transactor.h index 826490646..db1655e9a 100644 --- a/src/ripple/app/transactors/Transactor.h +++ b/src/ripple/app/transactors/Transactor.h @@ -20,6 +20,8 @@ #ifndef RIPPLE_TX_TRANSACTOR_H_INCLUDED #define RIPPLE_TX_TRANSACTOR_H_INCLUDED +#include + namespace ripple { class Transactor diff --git a/src/ripple/app/tx/LocalTxs.cpp b/src/ripple/app/tx/LocalTxs.cpp index 85b1371b8..1a97f9ce3 100644 --- a/src/ripple/app/tx/LocalTxs.cpp +++ b/src/ripple/app/tx/LocalTxs.cpp @@ -17,6 +17,10 @@ */ //============================================================================== +#include +#include +#include + /* This code prevents scenarios like the following: 1) A client submits a transaction. @@ -41,7 +45,6 @@ test-applied to all new open ledgers until seen in a fully- validated ledger */ - namespace ripple { // This class wraps a pointer to a transaction along with diff --git a/src/ripple/app/tx/Transaction.cpp b/src/ripple/app/tx/Transaction.cpp index 8c7f83ec5..e2236ce49 100644 --- a/src/ripple/app/tx/Transaction.cpp +++ b/src/ripple/app/tx/Transaction.cpp @@ -17,6 +17,13 @@ */ //============================================================================== +#include +#include +#include +#include +#include +#include + namespace ripple { Transaction::Transaction (STTx::ref sit, Validate validate) diff --git a/src/ripple/app/tx/TransactionAcquire.cpp b/src/ripple/app/tx/TransactionAcquire.cpp index 4c80895da..1b2767442 100644 --- a/src/ripple/app/tx/TransactionAcquire.cpp +++ b/src/ripple/app/tx/TransactionAcquire.cpp @@ -17,10 +17,16 @@ */ //============================================================================== +#include #include +#include +#include #include +#include +#include #include #include +#include namespace ripple { diff --git a/src/ripple/app/tx/TransactionAcquire.h b/src/ripple/app/tx/TransactionAcquire.h index 8b4caa6fe..e3ed40283 100644 --- a/src/ripple/app/tx/TransactionAcquire.h +++ b/src/ripple/app/tx/TransactionAcquire.h @@ -21,6 +21,7 @@ #define RIPPLE_TRANSACTIONACQUIRE_H #include +#include namespace ripple { diff --git a/src/ripple/app/tx/TransactionCheck.cpp b/src/ripple/app/tx/TransactionCheck.cpp index 494021c57..82478524c 100644 --- a/src/ripple/app/tx/TransactionCheck.cpp +++ b/src/ripple/app/tx/TransactionCheck.cpp @@ -17,6 +17,9 @@ */ //============================================================================== +#include +#include + namespace ripple { // VFALCO TODO move this into TransactionEngine.cpp diff --git a/src/ripple/app/tx/TransactionEngine.cpp b/src/ripple/app/tx/TransactionEngine.cpp index 326dcba11..59240054d 100644 --- a/src/ripple/app/tx/TransactionEngine.cpp +++ b/src/ripple/app/tx/TransactionEngine.cpp @@ -17,6 +17,15 @@ */ //============================================================================== +#include +#include +#include +#include +#include +#include +#include +#include + namespace ripple { // diff --git a/src/ripple/app/tx/TransactionMaster.cpp b/src/ripple/app/tx/TransactionMaster.cpp index 445a09a8b..f511ac62c 100644 --- a/src/ripple/app/tx/TransactionMaster.cpp +++ b/src/ripple/app/tx/TransactionMaster.cpp @@ -17,6 +17,10 @@ */ //============================================================================== +#include +#include +#include +#include #include namespace ripple { diff --git a/src/ripple/app/tx/TransactionMaster.h b/src/ripple/app/tx/TransactionMaster.h index c37c66283..0547edc1d 100644 --- a/src/ripple/app/tx/TransactionMaster.h +++ b/src/ripple/app/tx/TransactionMaster.h @@ -20,11 +20,15 @@ #ifndef __TRANSACTIONMASTER__ #define __TRANSACTIONMASTER__ +#include +#include +#include + namespace ripple { // Tracks all transactions in memory -class TransactionMaster : beast::LeakChecked +class TransactionMaster { public: TransactionMaster (); diff --git a/src/ripple/app/tx/TransactionMeta.cpp b/src/ripple/app/tx/TransactionMeta.cpp index 91b111de4..b12db2dbd 100644 --- a/src/ripple/app/tx/TransactionMeta.cpp +++ b/src/ripple/app/tx/TransactionMeta.cpp @@ -17,8 +17,13 @@ */ //============================================================================== +#include +#include +#include #include #include +#include +#include namespace ripple { diff --git a/src/ripple/app/websocket/WSConnection.cpp b/src/ripple/app/websocket/WSConnection.cpp index 3e1233147..c0041d09b 100644 --- a/src/ripple/app/websocket/WSConnection.cpp +++ b/src/ripple/app/websocket/WSConnection.cpp @@ -17,7 +17,10 @@ */ //============================================================================== +#include +#include #include +#include #include #include #include diff --git a/src/ripple/app/websocket/WSConnection.h b/src/ripple/app/websocket/WSConnection.h index 2ba9ac314..dd3439305 100644 --- a/src/ripple/app/websocket/WSConnection.h +++ b/src/ripple/app/websocket/WSConnection.h @@ -20,10 +20,13 @@ #ifndef RIPPLE_WSCONNECTION_H #define RIPPLE_WSCONNECTION_H +#include #include +#include #include #include #include +#include #include #include diff --git a/src/ripple/app/websocket/WSDoor.cpp b/src/ripple/app/websocket/WSDoor.cpp index 4c8847263..b808d7991 100644 --- a/src/ripple/app/websocket/WSDoor.cpp +++ b/src/ripple/app/websocket/WSDoor.cpp @@ -17,8 +17,13 @@ */ //============================================================================== +#include #include +#include +#include +#include #include // +#include namespace ripple { @@ -44,8 +49,8 @@ class WSDoorImp , beast::LeakChecked { private: - typedef RippleRecursiveMutex LockType; - typedef std::lock_guard ScopedLockType; + using LockType = std::recursive_mutex; + using ScopedLockType = std::lock_guard ; std::shared_ptr port_; Resource::Manager& m_resourceManager; diff --git a/src/ripple/app/websocket/WSDoor.h b/src/ripple/app/websocket/WSDoor.h index 6a0e6050a..fc2c41214 100644 --- a/src/ripple/app/websocket/WSDoor.h +++ b/src/ripple/app/websocket/WSDoor.h @@ -20,7 +20,10 @@ #ifndef RIPPLE_WSDOOR_H_INCLUDED #define RIPPLE_WSDOOR_H_INCLUDED +#include +#include #include +#include namespace ripple { diff --git a/src/ripple/app/websocket/WSServerHandler.cpp b/src/ripple/app/websocket/WSServerHandler.cpp index 65ff6988e..e51724603 100644 --- a/src/ripple/app/websocket/WSServerHandler.cpp +++ b/src/ripple/app/websocket/WSServerHandler.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/app/websocket/WSServerHandler.h b/src/ripple/app/websocket/WSServerHandler.h index 3224077ec..acfd958ea 100644 --- a/src/ripple/app/websocket/WSServerHandler.h +++ b/src/ripple/app/websocket/WSServerHandler.h @@ -20,11 +20,14 @@ #ifndef RIPPLE_WSSERVERHANDLER_H_INCLUDED #define RIPPLE_WSSERVERHANDLER_H_INCLUDED +#include +#include #include #include -#include #include +#include #include +#include namespace ripple { @@ -74,7 +77,7 @@ protected: LockType mLock; // For each connection maintain an associated object to track subscriptions. - typedef hash_map MapType; + using MapType = hash_map ; MapType mMap; public: diff --git a/src/ripple/basics/TestSuite.h b/src/ripple/basics/TestSuite.h index 02c4bc601..53ae18e9c 100644 --- a/src/ripple/basics/TestSuite.h +++ b/src/ripple/basics/TestSuite.h @@ -21,6 +21,7 @@ #define RIPPLED_RIPPLE_BASICS_TESTSUITE_H #include +#include namespace ripple { diff --git a/src/ripple/basics/impl/BasicConfig.cpp b/src/ripple/basics/impl/BasicConfig.cpp index f286d350d..bedf4a2f0 100644 --- a/src/ripple/basics/impl/BasicConfig.cpp +++ b/src/ripple/basics/impl/BasicConfig.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/basics/impl/CheckLibraryVersions.cpp b/src/ripple/basics/impl/CheckLibraryVersions.cpp index 76f6fb56d..7a999905d 100644 --- a/src/ripple/basics/impl/CheckLibraryVersions.cpp +++ b/src/ripple/basics/impl/CheckLibraryVersions.cpp @@ -17,15 +17,14 @@ */ //============================================================================== -#include -#include - +#include +#include #include #include #include #include - -#include +#include +#include namespace ripple { namespace version { diff --git a/src/ripple/basics/impl/CountedObject.cpp b/src/ripple/basics/impl/CountedObject.cpp index faf13942a..5d2c1d3cc 100644 --- a/src/ripple/basics/impl/CountedObject.cpp +++ b/src/ripple/basics/impl/CountedObject.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/basics/impl/Log.cpp b/src/ripple/basics/impl/Log.cpp index e4a7d3449..539cc62df 100644 --- a/src/ripple/basics/impl/Log.cpp +++ b/src/ripple/basics/impl/Log.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include // VFALCO TODO Use std::chrono diff --git a/src/ripple/basics/impl/RangeSet.cpp b/src/ripple/basics/impl/RangeSet.cpp index eab74572d..3420ec7d1 100644 --- a/src/ripple/basics/impl/RangeSet.cpp +++ b/src/ripple/basics/impl/RangeSet.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/basics/impl/ResolverAsio.cpp b/src/ripple/basics/impl/ResolverAsio.cpp index e1de28fa5..48ae2828b 100644 --- a/src/ripple/basics/impl/ResolverAsio.cpp +++ b/src/ripple/basics/impl/ResolverAsio.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/basics/impl/StringUtilities.cpp b/src/ripple/basics/impl/StringUtilities.cpp index af415a43d..76af616f7 100644 --- a/src/ripple/basics/impl/StringUtilities.cpp +++ b/src/ripple/basics/impl/StringUtilities.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/basics/impl/Sustain.cpp b/src/ripple/basics/impl/Sustain.cpp index 5ac79444e..96ed6782e 100644 --- a/src/ripple/basics/impl/Sustain.cpp +++ b/src/ripple/basics/impl/Sustain.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/basics/impl/TestSuite.test.cpp b/src/ripple/basics/impl/TestSuite.test.cpp index e64287c6c..741680b53 100644 --- a/src/ripple/basics/impl/TestSuite.test.cpp +++ b/src/ripple/basics/impl/TestSuite.test.cpp @@ -18,6 +18,7 @@ //============================================================================== #include +#include namespace ripple { diff --git a/src/ripple/basics/impl/ThreadName.cpp b/src/ripple/basics/impl/ThreadName.cpp index d1f62363b..000eae77a 100644 --- a/src/ripple/basics/impl/ThreadName.cpp +++ b/src/ripple/basics/impl/ThreadName.cpp @@ -17,6 +17,8 @@ */ //============================================================================== +#include + #if _MSC_VER #include diff --git a/src/ripple/basics/impl/Time.cpp b/src/ripple/basics/impl/Time.cpp index 49c2c5608..af9133b4d 100644 --- a/src/ripple/basics/impl/Time.cpp +++ b/src/ripple/basics/impl/Time.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/basics/impl/UptimeTimer.cpp b/src/ripple/basics/impl/UptimeTimer.cpp index 1385f9e72..72a0d0a77 100644 --- a/src/ripple/basics/impl/UptimeTimer.cpp +++ b/src/ripple/basics/impl/UptimeTimer.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include diff --git a/src/ripple/basics/impl/make_SSLContext.cpp b/src/ripple/basics/impl/make_SSLContext.cpp index 3e49e079b..1488ed2de 100644 --- a/src/ripple/basics/impl/make_SSLContext.cpp +++ b/src/ripple/basics/impl/make_SSLContext.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/basics/impl/strHex.cpp b/src/ripple/basics/impl/strHex.cpp index 25e855b0d..965ca6809 100644 --- a/src/ripple/basics/impl/strHex.cpp +++ b/src/ripple/basics/impl/strHex.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/basics/tests/CheckLibraryVersions.test.cpp b/src/ripple/basics/tests/CheckLibraryVersions.test.cpp index 2f8b48cf5..87a3bfbab 100644 --- a/src/ripple/basics/tests/CheckLibraryVersions.test.cpp +++ b/src/ripple/basics/tests/CheckLibraryVersions.test.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/basics/tests/KeyCache.test.cpp b/src/ripple/basics/tests/KeyCache.test.cpp index b27546039..e09444f3c 100644 --- a/src/ripple/basics/tests/KeyCache.test.cpp +++ b/src/ripple/basics/tests/KeyCache.test.cpp @@ -17,8 +17,8 @@ */ //============================================================================== +#include #include - #include #include diff --git a/src/ripple/basics/tests/RangeSet.test.cpp b/src/ripple/basics/tests/RangeSet.test.cpp index 832dc38b5..25c81240d 100644 --- a/src/ripple/basics/tests/RangeSet.test.cpp +++ b/src/ripple/basics/tests/RangeSet.test.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include diff --git a/src/ripple/basics/tests/StringUtilities.test.cpp b/src/ripple/basics/tests/StringUtilities.test.cpp index 00176ea5e..602400b05 100644 --- a/src/ripple/basics/tests/StringUtilities.test.cpp +++ b/src/ripple/basics/tests/StringUtilities.test.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/basics/tests/TaggedCache.test.cpp b/src/ripple/basics/tests/TaggedCache.test.cpp index c776372b1..cbda78d42 100644 --- a/src/ripple/basics/tests/TaggedCache.test.cpp +++ b/src/ripple/basics/tests/TaggedCache.test.cpp @@ -17,8 +17,8 @@ */ //============================================================================== +#include #include - #include #include diff --git a/src/ripple/core/JobQueue.h b/src/ripple/core/JobQueue.h index 19da732a8..648b8fd02 100644 --- a/src/ripple/core/JobQueue.h +++ b/src/ripple/core/JobQueue.h @@ -21,6 +21,7 @@ #define RIPPLE_CORE_JOBQUEUE_H_INCLUDED #include +#include #include #include #include diff --git a/src/ripple/core/impl/Config.cpp b/src/ripple/core/impl/Config.cpp index c0afda65c..b31d57975 100644 --- a/src/ripple/core/impl/Config.cpp +++ b/src/ripple/core/impl/Config.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/core/impl/Job.cpp b/src/ripple/core/impl/Job.cpp index 48499854b..4f5b4447d 100644 --- a/src/ripple/core/impl/Job.cpp +++ b/src/ripple/core/impl/Job.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/core/impl/JobQueue.cpp b/src/ripple/core/impl/JobQueue.cpp index 6aec69c87..4070c0920 100644 --- a/src/ripple/core/impl/JobQueue.cpp +++ b/src/ripple/core/impl/JobQueue.cpp @@ -17,15 +17,14 @@ */ //============================================================================== +#include #include #include #include #include - #include #include #include - #include #include #include diff --git a/src/ripple/core/impl/LoadEvent.cpp b/src/ripple/core/impl/LoadEvent.cpp index 82f058826..90bf2ccdd 100644 --- a/src/ripple/core/impl/LoadEvent.cpp +++ b/src/ripple/core/impl/LoadEvent.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include diff --git a/src/ripple/core/impl/LoadFeeTrackImp.cpp b/src/ripple/core/impl/LoadFeeTrackImp.cpp index c28c8a45d..10849d26a 100644 --- a/src/ripple/core/impl/LoadFeeTrackImp.cpp +++ b/src/ripple/core/impl/LoadFeeTrackImp.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include diff --git a/src/ripple/core/impl/LoadMonitor.cpp b/src/ripple/core/impl/LoadMonitor.cpp index 5a8dce039..dc39c5a20 100644 --- a/src/ripple/core/impl/LoadMonitor.cpp +++ b/src/ripple/core/impl/LoadMonitor.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/core/tests/LoadFeeTrack.test.cpp b/src/ripple/core/tests/LoadFeeTrack.test.cpp index 92f18f71a..2d49bcccb 100644 --- a/src/ripple/core/tests/LoadFeeTrack.test.cpp +++ b/src/ripple/core/tests/LoadFeeTrack.test.cpp @@ -17,7 +17,9 @@ */ //============================================================================== +#include #include +#include #include namespace ripple { diff --git a/src/ripple/crypto/ECDSACanonical.h b/src/ripple/crypto/ECDSACanonical.h index 012afb27e..5b0a61838 100644 --- a/src/ripple/crypto/ECDSACanonical.h +++ b/src/ripple/crypto/ECDSACanonical.h @@ -37,11 +37,14 @@ enum class ECDSA The return value for something that is not an ECDSA signature is unspecified. (But the function will not crash.) */ -bool isCanonicalECDSASig (void const* signature, size_t sigLen, ECDSA mustBeStrict); +bool isCanonicalECDSASig (void const* signature, + std::size_t sigLen, ECDSA mustBeStrict); -inline bool isCanonicalECDSASig (Blob const& signature, ECDSA mustBeStrict) +inline bool isCanonicalECDSASig (Blob const& signature, + ECDSA mustBeStrict) { - return signature.empty() ? false : isCanonicalECDSASig (&signature[0], signature.size(), mustBeStrict); + return signature.empty() ? false : + isCanonicalECDSASig (&signature[0], signature.size(), mustBeStrict); } /** Converts a canonical secp256k1 ECDSA signature to a @@ -52,7 +55,7 @@ inline bool isCanonicalECDSASig (Blob const& signature, ECDSA mustBeStrict) enough to accommodate the largest valid fully-canonical secp256k1 ECDSA signature (72 bytes). */ -bool makeCanonicalECDSASig (void *signature, size_t& sigLen); +bool makeCanonicalECDSASig (void *signature, std::size_t& sigLen); } diff --git a/src/ripple/crypto/impl/Base58.cpp b/src/ripple/crypto/impl/Base58.cpp index b16fc4eb2..adcbb2908 100644 --- a/src/ripple/crypto/impl/Base58.cpp +++ b/src/ripple/crypto/impl/Base58.cpp @@ -17,11 +17,11 @@ */ //============================================================================== +#include #include #include #include #include - #include #include diff --git a/src/ripple/crypto/impl/Base58Data.cpp b/src/ripple/crypto/impl/Base58Data.cpp index 4b6800de0..5c7c6fbc2 100644 --- a/src/ripple/crypto/impl/Base58Data.cpp +++ b/src/ripple/crypto/impl/Base58Data.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include diff --git a/src/ripple/crypto/impl/CBigNum.cpp b/src/ripple/crypto/impl/CBigNum.cpp index 47f0d351e..d17b6e95e 100644 --- a/src/ripple/crypto/impl/CBigNum.cpp +++ b/src/ripple/crypto/impl/CBigNum.cpp @@ -22,9 +22,9 @@ // Distributed under the MIT/X11 software license, see the accompanying // file license.txt or http://www.opensource.org/licenses/mit-license.php. +#include #include #include - #include #include diff --git a/src/ripple/crypto/impl/DHUtil.cpp b/src/ripple/crypto/impl/DHUtil.cpp index 28059ab70..7f71214e1 100644 --- a/src/ripple/crypto/impl/DHUtil.cpp +++ b/src/ripple/crypto/impl/DHUtil.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/crypto/impl/ECDSA.cpp b/src/ripple/crypto/impl/ECDSA.cpp index 629434b1e..3f7e731c1 100644 --- a/src/ripple/crypto/impl/ECDSA.cpp +++ b/src/ripple/crypto/impl/ECDSA.cpp @@ -22,6 +22,7 @@ // Distributed under the MIT/X11 software license, see the accompanying // file license.txt or http://www.opensource.org/licenses/mit-license.php. +#include #include #include #include diff --git a/src/ripple/crypto/impl/ECDSACanonical.cpp b/src/ripple/crypto/impl/ECDSACanonical.cpp index a6dadfb54..66ad596ab 100644 --- a/src/ripple/crypto/impl/ECDSACanonical.cpp +++ b/src/ripple/crypto/impl/ECDSACanonical.cpp @@ -17,12 +17,14 @@ */ //============================================================================== +#include #include #include -#include -#include #include #include +#include +#include +#include namespace ripple { @@ -48,7 +50,7 @@ struct BigNum BN_hex2bn (&num, hex); } - BigNum (unsigned char const* ptr, size_t len) + BigNum (unsigned char const* ptr, std::size_t len) : num (BN_new ()) { set (ptr, len); @@ -76,7 +78,7 @@ struct BigNum return num; } - bool set (unsigned char const* ptr, size_t len) + bool set (unsigned char const* ptr, std::size_t len) { if (BN_bin2bn (ptr, len, num) == nullptr) return false; @@ -88,18 +90,18 @@ struct BigNum class SignaturePart { private: - size_t m_skip; + std::size_t m_skip; BigNum m_bn; public: - SignaturePart (unsigned char const* sig, size_t size) + SignaturePart (unsigned char const* sig, std::size_t size) : m_skip (0) { // The format is: <02> if ((sig[0] != 0x02) || (size < 3)) return; - size_t const len (sig[1]); + std::size_t const len (sig[1]); // Claimed length can't be longer than amount of data available if (len > (size - 2)) @@ -139,7 +141,7 @@ public: } // Returns the number of bytes to skip for this signature part - size_t skip () const + std::size_t skip () const { return m_skip; } @@ -163,7 +165,7 @@ static BigNum const modulus ( https://bitcointalk.org/index.php?topic=8392.msg127623#msg127623 https://github.com/sipa/bitcoin/commit/58bc86e37fda1aec270bccb3df6c20fbd2a6591c */ -bool isCanonicalECDSASig (void const* vSig, size_t sigLen, ECDSA strict_param) +bool isCanonicalECDSASig (void const* vSig, std::size_t sigLen, ECDSA strict_param) { // The format of a signature should be: // <30> [ <02> ] [ <02> ] @@ -238,7 +240,7 @@ bool isCanonicalECDSASig (void const* vSig, size_t sigLen, ECDSA strict_param) @param sigLen the length of the signature @returns true if the signature was already canonical, false otherwise */ -bool makeCanonicalECDSASig (void* vSig, size_t& sigLen) +bool makeCanonicalECDSASig (void* vSig, std::size_t& sigLen) { unsigned char * sig = reinterpret_cast (vSig); bool ret = false; @@ -260,14 +262,14 @@ bool makeCanonicalECDSASig (void* vSig, size_t& sigLen) { // no extra padding byte is needed sig[1] = sig[1] - sLen + newSlen; sig[sPos - 1] = newSlen; - memcpy (&sig[sPos], newSbuf, newSlen); + std::memcpy (&sig[sPos], newSbuf, newSlen); } else { // an extra padding byte is needed sig[1] = sig[1] - sLen + newSlen + 1; sig[sPos - 1] = newSlen + 1; sig[sPos] = 0; - memcpy (&sig[sPos + 1], newSbuf, newSlen); + std::memcpy (&sig[sPos + 1], newSbuf, newSlen); } sigLen = sig[1] + 2; } diff --git a/src/ripple/crypto/impl/ECIES.cpp b/src/ripple/crypto/impl/ECIES.cpp index 44495119e..6b8bb974f 100644 --- a/src/ripple/crypto/impl/ECIES.cpp +++ b/src/ripple/crypto/impl/ECIES.cpp @@ -17,10 +17,12 @@ */ //============================================================================== +#include #include #include #include #include +#include #include namespace ripple { diff --git a/src/ripple/crypto/impl/GenerateDeterministicKey.cpp b/src/ripple/crypto/impl/GenerateDeterministicKey.cpp index ca7d4fcc7..797159e0f 100644 --- a/src/ripple/crypto/impl/GenerateDeterministicKey.cpp +++ b/src/ripple/crypto/impl/GenerateDeterministicKey.cpp @@ -17,11 +17,15 @@ */ //============================================================================== +#include #include #include #include #include #include +#include +#include +#include namespace ripple { diff --git a/src/ripple/crypto/impl/RFC1751.cpp b/src/ripple/crypto/impl/RFC1751.cpp index 8b7275ba0..16ea357a6 100644 --- a/src/ripple/crypto/impl/RFC1751.cpp +++ b/src/ripple/crypto/impl/RFC1751.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/crypto/impl/RandomNumbers.cpp b/src/ripple/crypto/impl/RandomNumbers.cpp index 68273f30b..5f792dd51 100644 --- a/src/ripple/crypto/impl/RandomNumbers.cpp +++ b/src/ripple/crypto/impl/RandomNumbers.cpp @@ -17,9 +17,10 @@ */ //============================================================================== +#include #include #include - +#include #include #include diff --git a/src/ripple/crypto/impl/ec_key.cpp b/src/ripple/crypto/impl/ec_key.cpp index 98434df68..4ea82d481 100644 --- a/src/ripple/crypto/impl/ec_key.cpp +++ b/src/ripple/crypto/impl/ec_key.cpp @@ -22,6 +22,7 @@ // Distributed under the MIT/X11 software license, see the accompanying // file license.txt or http://www.opensource.org/licenses/mit-license.php. +#include #include #include diff --git a/src/ripple/crypto/tests/CKey.test.cpp b/src/ripple/crypto/tests/CKey.test.cpp index 5abd654a2..877e2cfcd 100644 --- a/src/ripple/crypto/tests/CKey.test.cpp +++ b/src/ripple/crypto/tests/CKey.test.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/crypto/tests/ECDSACanonical.test.cpp b/src/ripple/crypto/tests/ECDSACanonical.test.cpp index ed120d4c1..6d9d69333 100644 --- a/src/ripple/crypto/tests/ECDSACanonical.test.cpp +++ b/src/ripple/crypto/tests/ECDSACanonical.test.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/json/JsonPropertyStream.h b/src/ripple/json/JsonPropertyStream.h index 04377c782..785203a18 100644 --- a/src/ripple/json/JsonPropertyStream.h +++ b/src/ripple/json/JsonPropertyStream.h @@ -20,6 +20,7 @@ #ifndef RIPPLE_JSONPROPERTYSTREAM_H_INCLUDED #define RIPPLE_JSONPROPERTYSTREAM_H_INCLUDED +#include #include namespace ripple { diff --git a/src/ripple/json/impl/JsonPropertyStream.cpp b/src/ripple/json/impl/JsonPropertyStream.cpp index 631de1f74..87546f5a7 100644 --- a/src/ripple/json/impl/JsonPropertyStream.cpp +++ b/src/ripple/json/impl/JsonPropertyStream.cpp @@ -17,6 +17,8 @@ */ //============================================================================== +#include +#include #include namespace ripple { diff --git a/src/ripple/json/impl/json_assert.h b/src/ripple/json/impl/json_assert.h new file mode 100644 index 000000000..ab1d5ef12 --- /dev/null +++ b/src/ripple/json/impl/json_assert.h @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +/* + This file is part of rippled: https://github.com/ripple/rippled + Copyright (c) 2012, 2013 Ripple Labs Inc. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ +//============================================================================== + +#ifndef JSONCPPTL_ASSERT_H_INCLUDED +#define JSONCPPTL_ASSERT_H_INCLUDED + +#define JSON_ASSERT_UNREACHABLE assert( false ) +#define JSON_ASSERT( condition ) assert( condition ); // @todo <= change this into an exception throw +#define JSON_ASSERT_MESSAGE( condition, message ) if (!( condition )) throw std::runtime_error( message ); + +#endif diff --git a/src/ripple/json/impl/json_reader.cpp b/src/ripple/json/impl/json_reader.cpp index abdf5e2ce..5c789e2bc 100644 --- a/src/ripple/json/impl/json_reader.cpp +++ b/src/ripple/json/impl/json_reader.cpp @@ -17,7 +17,9 @@ */ //============================================================================== +#include #include +#include namespace Json { diff --git a/src/ripple/json/impl/json_value.cpp b/src/ripple/json/impl/json_value.cpp index 02e96b635..c8e3ad0cd 100644 --- a/src/ripple/json/impl/json_value.cpp +++ b/src/ripple/json/impl/json_value.cpp @@ -17,9 +17,11 @@ */ //============================================================================== -#include +#include +#include #include #include +#include namespace Json { diff --git a/src/ripple/json/impl/json_writer.cpp b/src/ripple/json/impl/json_writer.cpp index 50d7009fb..8852a7efb 100644 --- a/src/ripple/json/impl/json_writer.cpp +++ b/src/ripple/json/impl/json_writer.cpp @@ -17,6 +17,11 @@ */ //============================================================================== +#include +#include +#include +#include +#include #include namespace Json diff --git a/src/ripple/json/impl/to_string.cpp b/src/ripple/json/impl/to_string.cpp index 1b173a226..f610a06b1 100644 --- a/src/ripple/json/impl/to_string.cpp +++ b/src/ripple/json/impl/to_string.cpp @@ -17,7 +17,9 @@ */ //============================================================================== +#include #include +#include namespace Json { diff --git a/src/ripple/json/json_features.h b/src/ripple/json/json_features.h index 153052e25..80c324e7c 100644 --- a/src/ripple/json/json_features.h +++ b/src/ripple/json/json_features.h @@ -20,6 +20,8 @@ #ifndef CPPTL_JSON_FEATURES_H_INCLUDED #define CPPTL_JSON_FEATURES_H_INCLUDED +#include + namespace Json { diff --git a/src/ripple/json/json_forwards.h b/src/ripple/json/json_forwards.h index c6fbf977f..a0bea19a0 100644 --- a/src/ripple/json/json_forwards.h +++ b/src/ripple/json/json_forwards.h @@ -20,6 +20,8 @@ #ifndef JSON_FORWARDS_H_INCLUDED #define JSON_FORWARDS_H_INCLUDED +#include + namespace Json { diff --git a/src/ripple/json/json_writer.h b/src/ripple/json/json_writer.h index db70d5856..5406467b3 100644 --- a/src/ripple/json/json_writer.h +++ b/src/ripple/json/json_writer.h @@ -20,6 +20,11 @@ #ifndef JSON_WRITER_H_INCLUDED #define JSON_WRITER_H_INCLUDED +#include +#include +#include +#include + namespace Json { diff --git a/src/ripple/json/tests/JsonCpp.test.cpp b/src/ripple/json/tests/JsonCpp.test.cpp index a91f1bf86..6bea69457 100644 --- a/src/ripple/json/tests/JsonCpp.test.cpp +++ b/src/ripple/json/tests/JsonCpp.test.cpp @@ -17,6 +17,9 @@ */ //============================================================================== +#include +#include +#include #include #include diff --git a/src/ripple/json/to_string.h b/src/ripple/json/to_string.h index 47ccd4cc6..e382b35da 100644 --- a/src/ripple/json/to_string.h +++ b/src/ripple/json/to_string.h @@ -20,8 +20,11 @@ #ifndef JSON_TO_STRING_H_INCLUDED #define JSON_TO_STRING_H_INCLUDED -namespace Json -{ +#include +#include +#include + +namespace Json { class Value; diff --git a/src/ripple/net/InfoSub.h b/src/ripple/net/InfoSub.h index c8cc48161..04c384fb7 100644 --- a/src/ripple/net/InfoSub.h +++ b/src/ripple/net/InfoSub.h @@ -21,6 +21,7 @@ #define RIPPLE_NET_RPC_INFOSUB_H_INCLUDED #include +#include #include #include #include diff --git a/src/ripple/net/RPCCall.h b/src/ripple/net/RPCCall.h index 509973882..1d85ffe4b 100644 --- a/src/ripple/net/RPCCall.h +++ b/src/ripple/net/RPCCall.h @@ -20,6 +20,12 @@ #ifndef RIPPLE_NET_RPC_RPCCALL_H_INCLUDED #define RIPPLE_NET_RPC_RPCCALL_H_INCLUDED +#include +#include +#include +#include +#include + namespace ripple { // diff --git a/src/ripple/net/RPCErr.h b/src/ripple/net/RPCErr.h index 4f7122357..bb695b98e 100644 --- a/src/ripple/net/RPCErr.h +++ b/src/ripple/net/RPCErr.h @@ -20,6 +20,8 @@ #ifndef RIPPLE_NET_RPC_RPCERR_H_INCLUDED #define RIPPLE_NET_RPC_RPCERR_H_INCLUDED +#include + namespace ripple { // VFALCO NOTE these are deprecated diff --git a/src/ripple/net/RPCSub.h b/src/ripple/net/RPCSub.h index 34e8ab210..9f590ed76 100644 --- a/src/ripple/net/RPCSub.h +++ b/src/ripple/net/RPCSub.h @@ -21,7 +21,9 @@ #define RIPPLE_NET_RPC_RPCSUB_H_INCLUDED #include +#include #include +#include namespace ripple { @@ -32,6 +34,7 @@ public: typedef std::shared_ptr pointer; typedef pointer const& ref; + // VFALCO Why is the io_service needed? static pointer New (InfoSub::Source& source, boost::asio::io_service& io_service, JobQueue& jobQueue, std::string const& strUrl, std::string const& strUsername, diff --git a/src/ripple/net/impl/HTTPClient.cpp b/src/ripple/net/impl/HTTPClient.cpp index 294e1f828..54d34d983 100644 --- a/src/ripple/net/impl/HTTPClient.cpp +++ b/src/ripple/net/impl/HTTPClient.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include @@ -24,6 +25,7 @@ #include #include #include +#include #include #include #include diff --git a/src/ripple/net/impl/HTTPRequest.cpp b/src/ripple/net/impl/HTTPRequest.cpp index c5a50e4f7..7a0a54cab 100644 --- a/src/ripple/net/impl/HTTPRequest.cpp +++ b/src/ripple/net/impl/HTTPRequest.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/net/impl/InfoSub.cpp b/src/ripple/net/impl/InfoSub.cpp index 9fe42452d..6f72af453 100644 --- a/src/ripple/net/impl/InfoSub.cpp +++ b/src/ripple/net/impl/InfoSub.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include diff --git a/src/ripple/net/impl/RPCCall.cpp b/src/ripple/net/impl/RPCCall.cpp index 080b4bef6..1dc6af52f 100644 --- a/src/ripple/net/impl/RPCCall.cpp +++ b/src/ripple/net/impl/RPCCall.cpp @@ -17,13 +17,20 @@ */ //============================================================================== -#include -#include -#include -#include -#include +#include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include diff --git a/src/ripple/net/impl/RPCErr.cpp b/src/ripple/net/impl/RPCErr.cpp index 43203687b..9cab5b3e3 100644 --- a/src/ripple/net/impl/RPCErr.cpp +++ b/src/ripple/net/impl/RPCErr.cpp @@ -17,6 +17,10 @@ */ //============================================================================== +#include +#include +#include + namespace ripple { struct RPCErr; diff --git a/src/ripple/net/impl/RPCSub.cpp b/src/ripple/net/impl/RPCSub.cpp index 9b27bc4ad..af7bdf293 100644 --- a/src/ripple/net/impl/RPCSub.cpp +++ b/src/ripple/net/impl/RPCSub.cpp @@ -17,8 +17,13 @@ */ //============================================================================== -#include +#include #include +#include +#include +#include +#include +#include namespace ripple { diff --git a/src/ripple/net/impl/SNTPClient.cpp b/src/ripple/net/impl/SNTPClient.cpp index 3246aaf20..478e42fbb 100644 --- a/src/ripple/net/impl/SNTPClient.cpp +++ b/src/ripple/net/impl/SNTPClient.cpp @@ -17,12 +17,15 @@ */ //============================================================================== +#include #include #include #include #include #include +#include #include +#include namespace ripple { @@ -345,8 +348,8 @@ public: } private: - typedef RippleMutex LockType; - typedef std::lock_guard ScopedLockType; + using LockType = std::mutex; + using ScopedLockType = std::lock_guard ; LockType mLock; boost::asio::io_service m_io_service; diff --git a/src/ripple/nodestore/backend/HyperDBFactory.cpp b/src/ripple/nodestore/backend/HyperDBFactory.cpp index 03dd800e1..c13edb633 100644 --- a/src/ripple/nodestore/backend/HyperDBFactory.cpp +++ b/src/ripple/nodestore/backend/HyperDBFactory.cpp @@ -17,6 +17,10 @@ */ //============================================================================== +#include + +#include + #if RIPPLE_HYPERLEVELDB_AVAILABLE #include // VFALCO Bad dependency diff --git a/src/ripple/nodestore/backend/LevelDBFactory.cpp b/src/ripple/nodestore/backend/LevelDBFactory.cpp index 6716a74e9..89ce6d6ec 100644 --- a/src/ripple/nodestore/backend/LevelDBFactory.cpp +++ b/src/ripple/nodestore/backend/LevelDBFactory.cpp @@ -17,6 +17,10 @@ */ //============================================================================== +#include + +#include + #if RIPPLE_LEVELDB_AVAILABLE #include // VFALCO Bad dependency @@ -261,19 +265,10 @@ public: class LevelDBFactory : public Factory { public: - std::unique_ptr m_lruCache; - class BackendImp; LevelDBFactory () - : m_lruCache (nullptr) { - leveldb::Options options; - options.create_if_missing = true; - options.block_cache = leveldb::NewLRUCache ( - getConfig ().getSize (siHashNodeDBCache) * 1024 * 1024); - m_lruCache.reset (options.block_cache); - Manager::instance().insert(*this); } diff --git a/src/ripple/nodestore/backend/MemoryFactory.cpp b/src/ripple/nodestore/backend/MemoryFactory.cpp index eab59e258..96921ca9d 100644 --- a/src/ripple/nodestore/backend/MemoryFactory.cpp +++ b/src/ripple/nodestore/backend/MemoryFactory.cpp @@ -17,9 +17,11 @@ */ //============================================================================== +#include #include #include #include // +#include namespace ripple { namespace NodeStore { diff --git a/src/ripple/nodestore/backend/NullFactory.cpp b/src/ripple/nodestore/backend/NullFactory.cpp index a8fa0e93c..c607503da 100644 --- a/src/ripple/nodestore/backend/NullFactory.cpp +++ b/src/ripple/nodestore/backend/NullFactory.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include // diff --git a/src/ripple/nodestore/backend/RocksDBFactory.cpp b/src/ripple/nodestore/backend/RocksDBFactory.cpp index 58d9d353c..ab4b04bd1 100644 --- a/src/ripple/nodestore/backend/RocksDBFactory.cpp +++ b/src/ripple/nodestore/backend/RocksDBFactory.cpp @@ -17,6 +17,10 @@ */ //============================================================================== +#include + +#include + #if RIPPLE_ROCKSDB_AVAILABLE #include // VFALCO Bad dependency @@ -361,18 +365,10 @@ public: class RocksDBFactory : public Factory { public: - std::shared_ptr m_lruCache; RocksDBEnv m_env; RocksDBFactory () { - rocksdb::BlockBasedTableOptions table_options; - - table_options.block_cache = rocksdb::NewLRUCache ( - getConfig ().getSize (siHashNodeDBCache) * 1024 * 1024); - - m_lruCache = table_options.block_cache; - Manager::instance().insert(*this); } diff --git a/src/ripple/nodestore/backend/RocksDBQuickFactory.cpp b/src/ripple/nodestore/backend/RocksDBQuickFactory.cpp index 56183fec4..559fd7da2 100644 --- a/src/ripple/nodestore/backend/RocksDBQuickFactory.cpp +++ b/src/ripple/nodestore/backend/RocksDBQuickFactory.cpp @@ -17,6 +17,10 @@ */ //============================================================================== +#include + +#include + #if RIPPLE_ROCKSDB_AVAILABLE #include // VFALCO Bad dependency diff --git a/src/ripple/nodestore/impl/BatchWriter.cpp b/src/ripple/nodestore/impl/BatchWriter.cpp index 9e67f1f6f..24a27c3e5 100644 --- a/src/ripple/nodestore/impl/BatchWriter.cpp +++ b/src/ripple/nodestore/impl/BatchWriter.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/nodestore/impl/DatabaseRotatingImp.cpp b/src/ripple/nodestore/impl/DatabaseRotatingImp.cpp index 3842d6df7..106c814bf 100644 --- a/src/ripple/nodestore/impl/DatabaseRotatingImp.cpp +++ b/src/ripple/nodestore/impl/DatabaseRotatingImp.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/nodestore/impl/DecodedBlob.cpp b/src/ripple/nodestore/impl/DecodedBlob.cpp index f947186a2..36b8a0aad 100644 --- a/src/ripple/nodestore/impl/DecodedBlob.cpp +++ b/src/ripple/nodestore/impl/DecodedBlob.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/nodestore/impl/DummyScheduler.cpp b/src/ripple/nodestore/impl/DummyScheduler.cpp index be4b4d480..d90c0ca2d 100644 --- a/src/ripple/nodestore/impl/DummyScheduler.cpp +++ b/src/ripple/nodestore/impl/DummyScheduler.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/nodestore/impl/EncodedBlob.cpp b/src/ripple/nodestore/impl/EncodedBlob.cpp index 7faf511ee..db9fbfa4b 100644 --- a/src/ripple/nodestore/impl/EncodedBlob.cpp +++ b/src/ripple/nodestore/impl/EncodedBlob.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include diff --git a/src/ripple/nodestore/impl/ManagerImp.cpp b/src/ripple/nodestore/impl/ManagerImp.cpp index e8a9a7a02..f45da06ea 100644 --- a/src/ripple/nodestore/impl/ManagerImp.cpp +++ b/src/ripple/nodestore/impl/ManagerImp.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/nodestore/impl/NodeObject.cpp b/src/ripple/nodestore/impl/NodeObject.cpp index 83df40900..9ee8dc34f 100644 --- a/src/ripple/nodestore/impl/NodeObject.cpp +++ b/src/ripple/nodestore/impl/NodeObject.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include diff --git a/src/ripple/nodestore/tests/Backend.test.cpp b/src/ripple/nodestore/tests/Backend.test.cpp index 9175eb48d..3348fb43e 100644 --- a/src/ripple/nodestore/tests/Backend.test.cpp +++ b/src/ripple/nodestore/tests/Backend.test.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/nodestore/tests/Basics.test.cpp b/src/ripple/nodestore/tests/Basics.test.cpp index a15c8183d..cbefd8f4f 100644 --- a/src/ripple/nodestore/tests/Basics.test.cpp +++ b/src/ripple/nodestore/tests/Basics.test.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/nodestore/tests/Database.test.cpp b/src/ripple/nodestore/tests/Database.test.cpp index 3bf516231..0ee219136 100644 --- a/src/ripple/nodestore/tests/Database.test.cpp +++ b/src/ripple/nodestore/tests/Database.test.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/nodestore/tests/Timing.test.cpp b/src/ripple/nodestore/tests/Timing.test.cpp index df0aa9a4a..06820139a 100644 --- a/src/ripple/nodestore/tests/Timing.test.cpp +++ b/src/ripple/nodestore/tests/Timing.test.cpp @@ -17,11 +17,13 @@ */ //============================================================================== +#include #include #include #include #include #include +#include namespace ripple { namespace NodeStore { diff --git a/src/ripple/overlay/impl/ConnectAttempt.cpp b/src/ripple/overlay/impl/ConnectAttempt.cpp index 833655a1a..41a16d2e2 100644 --- a/src/ripple/overlay/impl/ConnectAttempt.cpp +++ b/src/ripple/overlay/impl/ConnectAttempt.cpp @@ -17,7 +17,9 @@ */ //============================================================================== +#include #include +#include #include #include diff --git a/src/ripple/overlay/impl/Message.cpp b/src/ripple/overlay/impl/Message.cpp index 851ecf440..947bc5bc7 100644 --- a/src/ripple/overlay/impl/Message.cpp +++ b/src/ripple/overlay/impl/Message.cpp @@ -17,8 +17,8 @@ */ //============================================================================== +#include #include - #include namespace ripple { diff --git a/src/ripple/overlay/impl/OverlayImpl.cpp b/src/ripple/overlay/impl/OverlayImpl.cpp index 4bedcf394..d751cb6cf 100644 --- a/src/ripple/overlay/impl/OverlayImpl.cpp +++ b/src/ripple/overlay/impl/OverlayImpl.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/overlay/impl/PeerImp.cpp b/src/ripple/overlay/impl/PeerImp.cpp index f4cf54b5d..676985a7b 100644 --- a/src/ripple/overlay/impl/PeerImp.cpp +++ b/src/ripple/overlay/impl/PeerImp.cpp @@ -17,18 +17,26 @@ */ //============================================================================== +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include #include -#include -#include -#include #include #include #include #include #include +#include #include #include // #include diff --git a/src/ripple/overlay/impl/PeerImp.h b/src/ripple/overlay/impl/PeerImp.h index 82927387d..75eee1bcc 100644 --- a/src/ripple/overlay/impl/PeerImp.h +++ b/src/ripple/overlay/impl/PeerImp.h @@ -20,15 +20,19 @@ #ifndef RIPPLE_OVERLAY_PEERIMP_H_INCLUDED #define RIPPLE_OVERLAY_PEERIMP_H_INCLUDED +#include +#include // deprecated #include #include #include #include #include +#include #include +#include #include +#include #include -#include // VFALCO REMOVE #include #include #include @@ -84,9 +88,6 @@ private: using address_type = boost::asio::ip::address; using endpoint_type = boost::asio::ip::tcp::endpoint; - // Time alloted for a peer to send a HELLO message (DEPRECATED) - static const boost::posix_time::seconds nodeVerifySeconds; - // The length of the smallest valid finished message static const size_t sslMinimumFinishedLength = 12; @@ -523,11 +524,6 @@ PeerImp::sendEndpoints (FwdIt first, FwdIt last) send (std::make_shared (tm, protocol::mtENDPOINTS)); } -//------------------------------------------------------------------------------ - -// DEPRECATED -const boost::posix_time::seconds PeerImp::nodeVerifySeconds (15); - } #endif diff --git a/src/ripple/overlay/impl/TMHello.cpp b/src/ripple/overlay/impl/TMHello.cpp index 46404cca3..8807ed7e2 100644 --- a/src/ripple/overlay/impl/TMHello.cpp +++ b/src/ripple/overlay/impl/TMHello.cpp @@ -17,7 +17,11 @@ */ //============================================================================== +#include +#include #include +#include +#include #include #include #include diff --git a/src/ripple/overlay/impl/TMHello.h b/src/ripple/overlay/impl/TMHello.h index a71ea280b..dd9b79d02 100644 --- a/src/ripple/overlay/impl/TMHello.h +++ b/src/ripple/overlay/impl/TMHello.h @@ -20,14 +20,18 @@ #ifndef RIPPLE_OVERLAY_TMHELLO_H_INCLUDED #define RIPPLE_OVERLAY_TMHELLO_H_INCLUDED -#include "ripple.pb.h" #include #include +#include #include #include #include #include +#include + +#include "ripple.pb.h" + namespace ripple { enum diff --git a/src/ripple/overlay/tests/TMHello.test.cpp b/src/ripple/overlay/tests/TMHello.test.cpp index aa68278a8..94506ab6e 100644 --- a/src/ripple/overlay/tests/TMHello.test.cpp +++ b/src/ripple/overlay/tests/TMHello.test.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include diff --git a/src/ripple/overlay/tests/short_read.test.cpp b/src/ripple/overlay/tests/short_read.test.cpp index 04d25dcb6..780f2a399 100644 --- a/src/ripple/overlay/tests/short_read.test.cpp +++ b/src/ripple/overlay/tests/short_read.test.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/peerfinder/impl/Bootcache.cpp b/src/ripple/peerfinder/impl/Bootcache.cpp index 8570672f8..7d6cdd0a3 100644 --- a/src/ripple/peerfinder/impl/Bootcache.cpp +++ b/src/ripple/peerfinder/impl/Bootcache.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/peerfinder/impl/Counts.h b/src/ripple/peerfinder/impl/Counts.h index 099111e47..4e87d36ce 100644 --- a/src/ripple/peerfinder/impl/Counts.h +++ b/src/ripple/peerfinder/impl/Counts.h @@ -22,6 +22,7 @@ #include #include +#include #include namespace ripple { diff --git a/src/ripple/peerfinder/impl/Endpoint.cpp b/src/ripple/peerfinder/impl/Endpoint.cpp index 07acd8c9a..b2656a3bb 100644 --- a/src/ripple/peerfinder/impl/Endpoint.cpp +++ b/src/ripple/peerfinder/impl/Endpoint.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/peerfinder/impl/Livecache.h b/src/ripple/peerfinder/impl/Livecache.h index 99835e1a0..d5d92d833 100644 --- a/src/ripple/peerfinder/impl/Livecache.h +++ b/src/ripple/peerfinder/impl/Livecache.h @@ -21,6 +21,8 @@ #define RIPPLE_PEERFINDER_LIVECACHE_H_INCLUDED #include +#include +#include #include #include #include diff --git a/src/ripple/peerfinder/impl/Logic.h b/src/ripple/peerfinder/impl/Logic.h index 98e2b2f5f..6cb2b0591 100644 --- a/src/ripple/peerfinder/impl/Logic.h +++ b/src/ripple/peerfinder/impl/Logic.h @@ -21,6 +21,7 @@ #define RIPPLE_PEERFINDER_LOGIC_H_INCLUDED #include +#include #include #include #include @@ -29,6 +30,7 @@ #include #include #include +#include #include #include #include diff --git a/src/ripple/peerfinder/impl/Manager.cpp b/src/ripple/peerfinder/impl/Manager.cpp index 61021ffa7..3ec935b68 100644 --- a/src/ripple/peerfinder/impl/Manager.cpp +++ b/src/ripple/peerfinder/impl/Manager.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/peerfinder/impl/Config.cpp b/src/ripple/peerfinder/impl/PeerfinderConfig.cpp similarity index 96% rename from src/ripple/peerfinder/impl/Config.cpp rename to src/ripple/peerfinder/impl/PeerfinderConfig.cpp index d46a3260e..4f10d1446 100644 --- a/src/ripple/peerfinder/impl/Config.cpp +++ b/src/ripple/peerfinder/impl/PeerfinderConfig.cpp @@ -17,7 +17,9 @@ */ //============================================================================== +#include #include +#include namespace ripple { namespace PeerFinder { diff --git a/src/ripple/peerfinder/impl/SlotImp.cpp b/src/ripple/peerfinder/impl/SlotImp.cpp index ca10461e9..32f9cbca6 100644 --- a/src/ripple/peerfinder/impl/SlotImp.cpp +++ b/src/ripple/peerfinder/impl/SlotImp.cpp @@ -17,7 +17,10 @@ */ //============================================================================== +#include #include +#include +#include namespace ripple { namespace PeerFinder { diff --git a/src/ripple/peerfinder/impl/SlotImp.h b/src/ripple/peerfinder/impl/SlotImp.h index de95bacf4..fcffb9ad8 100644 --- a/src/ripple/peerfinder/impl/SlotImp.h +++ b/src/ripple/peerfinder/impl/SlotImp.h @@ -21,6 +21,7 @@ #define RIPPLE_PEERFINDER_SLOTIMP_H_INCLUDED #include +#include #include #include #include diff --git a/src/ripple/peerfinder/impl/Source.h b/src/ripple/peerfinder/impl/Source.h index 4354f90ff..2adc357d6 100644 --- a/src/ripple/peerfinder/impl/Source.h +++ b/src/ripple/peerfinder/impl/Source.h @@ -20,6 +20,7 @@ #ifndef RIPPLE_PEERFINDER_SOURCE_H_INCLUDED #define RIPPLE_PEERFINDER_SOURCE_H_INCLUDED +#include #include #include diff --git a/src/ripple/peerfinder/impl/SourceStrings.cpp b/src/ripple/peerfinder/impl/SourceStrings.cpp index 9028b66a5..8aca7b585 100644 --- a/src/ripple/peerfinder/impl/SourceStrings.cpp +++ b/src/ripple/peerfinder/impl/SourceStrings.cpp @@ -17,6 +17,9 @@ */ //============================================================================== +#include +#include + namespace ripple { namespace PeerFinder { diff --git a/src/ripple/peerfinder/impl/SourceStrings.h b/src/ripple/peerfinder/impl/SourceStrings.h index 96a84d572..98aa521d1 100644 --- a/src/ripple/peerfinder/impl/SourceStrings.h +++ b/src/ripple/peerfinder/impl/SourceStrings.h @@ -20,6 +20,9 @@ #ifndef RIPPLE_PEERFINDER_SOURCESTRINGS_H_INCLUDED #define RIPPLE_PEERFINDER_SOURCESTRINGS_H_INCLUDED +#include +#include + namespace ripple { namespace PeerFinder { diff --git a/src/ripple/peerfinder/sim/Tests.cpp b/src/ripple/peerfinder/sim/Tests.cpp index d24a56454..b961b46b5 100644 --- a/src/ripple/peerfinder/sim/Tests.cpp +++ b/src/ripple/peerfinder/sim/Tests.cpp @@ -17,6 +17,8 @@ */ //============================================================================== +#include + #if 0 namespace ripple { diff --git a/src/ripple/peerfinder/tests/Livecache.test.cpp b/src/ripple/peerfinder/tests/Livecache.test.cpp index 839e11a0d..06849c468 100644 --- a/src/ripple/peerfinder/tests/Livecache.test.cpp +++ b/src/ripple/peerfinder/tests/Livecache.test.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/protocol/ErrorCodes.h b/src/ripple/protocol/ErrorCodes.h index 0b0265826..62916019e 100644 --- a/src/ripple/protocol/ErrorCodes.h +++ b/src/ripple/protocol/ErrorCodes.h @@ -118,6 +118,8 @@ enum error_code_i //------------------------------------------------------------------------------ +// VFALCO NOTE these should probably not be in the RPC namespace. + namespace RPC { /** Maps an rpc error code to its token and default message. */ diff --git a/src/ripple/protocol/Indexes.h b/src/ripple/protocol/Indexes.h index cae3fcfdd..4152a889c 100644 --- a/src/ripple/protocol/Indexes.h +++ b/src/ripple/protocol/Indexes.h @@ -74,6 +74,7 @@ getQualityIndex (uint256 const& uBase, const std::uint64_t uNodeDir = 0); uint256 getQualityNext (uint256 const& uBase); +// VFALCO This name could be better std::uint64_t getQuality (uint256 const& uBase); diff --git a/src/ripple/protocol/STParsedJSON.h b/src/ripple/protocol/STParsedJSON.h index 373815220..211a7cc09 100644 --- a/src/ripple/protocol/STParsedJSON.h +++ b/src/ripple/protocol/STParsedJSON.h @@ -20,6 +20,8 @@ #ifndef RIPPLE_PROTOCOL_STPARSEDJSON_H_INCLUDED #define RIPPLE_PROTOCOL_STPARSEDJSON_H_INCLUDED +#include + namespace ripple { /** Holds the serialized result of parsing an input JSON object. diff --git a/src/ripple/protocol/impl/BuildInfo.cpp b/src/ripple/protocol/impl/BuildInfo.cpp index b900b8a2d..29068dbba 100644 --- a/src/ripple/protocol/impl/BuildInfo.cpp +++ b/src/ripple/protocol/impl/BuildInfo.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/protocol/impl/ByteOrder.cpp b/src/ripple/protocol/impl/ByteOrder.cpp index 8619dce89..9a14047fd 100644 --- a/src/ripple/protocol/impl/ByteOrder.cpp +++ b/src/ripple/protocol/impl/ByteOrder.cpp @@ -17,7 +17,10 @@ */ //============================================================================== -#ifdef BEAST_WIN32 +#include + +#ifdef _MSC_VER +#include #include // defines min, max and does other stupid things # ifdef max @@ -30,7 +33,7 @@ namespace ripple { -#if BEAST_WIN32 +#if _MSC_VER // from: http://stackoverflow.com/questions/3022552/is-there-any-standard-htonl-like-function-for-64-bits-integers-in-c // but we don't need to check the endianness diff --git a/src/ripple/protocol/impl/ErrorCodes.cpp b/src/ripple/protocol/impl/ErrorCodes.cpp index 10e1e3923..0d7cda8e0 100644 --- a/src/ripple/protocol/impl/ErrorCodes.cpp +++ b/src/ripple/protocol/impl/ErrorCodes.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/protocol/impl/HashPrefix.cpp b/src/ripple/protocol/impl/HashPrefix.cpp index 0b5a2bf02..a0c3d0935 100644 --- a/src/ripple/protocol/impl/HashPrefix.cpp +++ b/src/ripple/protocol/impl/HashPrefix.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/protocol/impl/Indexes.cpp b/src/ripple/protocol/impl/Indexes.cpp index 60ef7abf3..54a43ddaa 100644 --- a/src/ripple/protocol/impl/Indexes.cpp +++ b/src/ripple/protocol/impl/Indexes.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/protocol/impl/LedgerFormats.cpp b/src/ripple/protocol/impl/LedgerFormats.cpp index 4e4b1f0d4..440298cbe 100644 --- a/src/ripple/protocol/impl/LedgerFormats.cpp +++ b/src/ripple/protocol/impl/LedgerFormats.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include diff --git a/src/ripple/protocol/impl/RippleAddress.cpp b/src/ripple/protocol/impl/RippleAddress.cpp index 4cda1a832..393e63a9b 100644 --- a/src/ripple/protocol/impl/RippleAddress.cpp +++ b/src/ripple/protocol/impl/RippleAddress.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/protocol/impl/SField.cpp b/src/ripple/protocol/impl/SField.cpp index b86a7b8b7..7eb2b2bac 100644 --- a/src/ripple/protocol/impl/SField.cpp +++ b/src/ripple/protocol/impl/SField.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/protocol/impl/SOTemplate.cpp b/src/ripple/protocol/impl/SOTemplate.cpp index b8ac4a447..50302ea22 100644 --- a/src/ripple/protocol/impl/SOTemplate.cpp +++ b/src/ripple/protocol/impl/SOTemplate.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/protocol/impl/STAccount.cpp b/src/ripple/protocol/impl/STAccount.cpp index 48a0dff6b..f19336c5f 100644 --- a/src/ripple/protocol/impl/STAccount.cpp +++ b/src/ripple/protocol/impl/STAccount.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/protocol/impl/STAmount.cpp b/src/ripple/protocol/impl/STAmount.cpp index 2403933df..10f140c8a 100644 --- a/src/ripple/protocol/impl/STAmount.cpp +++ b/src/ripple/protocol/impl/STAmount.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/protocol/impl/STArray.cpp b/src/ripple/protocol/impl/STArray.cpp index fcca8790b..28049d16d 100644 --- a/src/ripple/protocol/impl/STArray.cpp +++ b/src/ripple/protocol/impl/STArray.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/protocol/impl/STBase.cpp b/src/ripple/protocol/impl/STBase.cpp index f03e81e79..47e6eb07c 100644 --- a/src/ripple/protocol/impl/STBase.cpp +++ b/src/ripple/protocol/impl/STBase.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/protocol/impl/STBlob.cpp b/src/ripple/protocol/impl/STBlob.cpp index 153739213..c5cc0ce28 100644 --- a/src/ripple/protocol/impl/STBlob.cpp +++ b/src/ripple/protocol/impl/STBlob.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include diff --git a/src/ripple/protocol/impl/STInteger.cpp b/src/ripple/protocol/impl/STInteger.cpp index 523c14328..cdc8753f9 100644 --- a/src/ripple/protocol/impl/STInteger.cpp +++ b/src/ripple/protocol/impl/STInteger.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/protocol/impl/STLedgerEntry.cpp b/src/ripple/protocol/impl/STLedgerEntry.cpp index ab9c9d230..41045eebf 100644 --- a/src/ripple/protocol/impl/STLedgerEntry.cpp +++ b/src/ripple/protocol/impl/STLedgerEntry.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/protocol/impl/STObject.cpp b/src/ripple/protocol/impl/STObject.cpp index e9d9dda3f..37049d5ab 100644 --- a/src/ripple/protocol/impl/STObject.cpp +++ b/src/ripple/protocol/impl/STObject.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/protocol/impl/STParsedJSON.cpp b/src/ripple/protocol/impl/STParsedJSON.cpp index 933f4f0a0..2e7194746 100644 --- a/src/ripple/protocol/impl/STParsedJSON.cpp +++ b/src/ripple/protocol/impl/STParsedJSON.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/protocol/impl/STPathSet.cpp b/src/ripple/protocol/impl/STPathSet.cpp index 8f5026dad..72da163ba 100644 --- a/src/ripple/protocol/impl/STPathSet.cpp +++ b/src/ripple/protocol/impl/STPathSet.cpp @@ -17,11 +17,13 @@ */ //============================================================================== +#include #include #include #include #include #include +#include namespace ripple { diff --git a/src/ripple/protocol/impl/STTx.cpp b/src/ripple/protocol/impl/STTx.cpp index 6cbf438e1..847006264 100644 --- a/src/ripple/protocol/impl/STTx.cpp +++ b/src/ripple/protocol/impl/STTx.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/protocol/impl/STValidation.cpp b/src/ripple/protocol/impl/STValidation.cpp index 683d1693a..6c6b026a3 100644 --- a/src/ripple/protocol/impl/STValidation.cpp +++ b/src/ripple/protocol/impl/STValidation.cpp @@ -17,10 +17,11 @@ */ //============================================================================== +#include #include #include -#include #include +#include namespace ripple { diff --git a/src/ripple/protocol/impl/STVector256.cpp b/src/ripple/protocol/impl/STVector256.cpp index f7f4dc752..d2a175a62 100644 --- a/src/ripple/protocol/impl/STVector256.cpp +++ b/src/ripple/protocol/impl/STVector256.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/protocol/impl/Serializer.cpp b/src/ripple/protocol/impl/Serializer.cpp index 922bfed2b..d0c9bff90 100644 --- a/src/ripple/protocol/impl/Serializer.cpp +++ b/src/ripple/protocol/impl/Serializer.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/protocol/impl/TER.cpp b/src/ripple/protocol/impl/TER.cpp index 62cad689e..963321622 100644 --- a/src/ripple/protocol/impl/TER.cpp +++ b/src/ripple/protocol/impl/TER.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/protocol/impl/TxFormats.cpp b/src/ripple/protocol/impl/TxFormats.cpp index f151f71cb..56cfe50b7 100644 --- a/src/ripple/protocol/impl/TxFormats.cpp +++ b/src/ripple/protocol/impl/TxFormats.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/protocol/impl/UintTypes.cpp b/src/ripple/protocol/impl/UintTypes.cpp index 7ab564530..718778b38 100644 --- a/src/ripple/protocol/impl/UintTypes.cpp +++ b/src/ripple/protocol/impl/UintTypes.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/protocol/tests/BuildInfo.test.cpp b/src/ripple/protocol/tests/BuildInfo.test.cpp index e5f489354..7ed925163 100644 --- a/src/ripple/protocol/tests/BuildInfo.test.cpp +++ b/src/ripple/protocol/tests/BuildInfo.test.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/protocol/tests/Issue.test.cpp b/src/ripple/protocol/tests/Issue.test.cpp index f61cc79cf..0c7bf9df1 100644 --- a/src/ripple/protocol/tests/Issue.test.cpp +++ b/src/ripple/protocol/tests/Issue.test.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/protocol/tests/RippleAddress.test.cpp b/src/ripple/protocol/tests/RippleAddress.test.cpp index 5b8dc9050..ce5923207 100644 --- a/src/ripple/protocol/tests/RippleAddress.test.cpp +++ b/src/ripple/protocol/tests/RippleAddress.test.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/protocol/tests/STAmount.test.cpp b/src/ripple/protocol/tests/STAmount.test.cpp index d1265079d..f21d6fd85 100644 --- a/src/ripple/protocol/tests/STAmount.test.cpp +++ b/src/ripple/protocol/tests/STAmount.test.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/protocol/tests/STObject.test.cpp b/src/ripple/protocol/tests/STObject.test.cpp index f18385602..80e958023 100644 --- a/src/ripple/protocol/tests/STObject.test.cpp +++ b/src/ripple/protocol/tests/STObject.test.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/protocol/tests/STTx.test.cpp b/src/ripple/protocol/tests/STTx.test.cpp index 705a789ce..f267e89de 100644 --- a/src/ripple/protocol/tests/STTx.test.cpp +++ b/src/ripple/protocol/tests/STTx.test.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/protocol/tests/Serializer.test.cpp b/src/ripple/protocol/tests/Serializer.test.cpp index e64621eaa..3ae89ace0 100644 --- a/src/ripple/protocol/tests/Serializer.test.cpp +++ b/src/ripple/protocol/tests/Serializer.test.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include diff --git a/src/ripple/resource/impl/Charge.cpp b/src/ripple/resource/impl/Charge.cpp index 40b5656b6..5009a97c7 100644 --- a/src/ripple/resource/impl/Charge.cpp +++ b/src/ripple/resource/impl/Charge.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include diff --git a/src/ripple/resource/impl/Consumer.cpp b/src/ripple/resource/impl/Consumer.cpp index a2f191d21..8c15d622a 100644 --- a/src/ripple/resource/impl/Consumer.cpp +++ b/src/ripple/resource/impl/Consumer.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/resource/impl/Fees.cpp b/src/ripple/resource/impl/Fees.cpp index cad098350..8d305452b 100644 --- a/src/ripple/resource/impl/Fees.cpp +++ b/src/ripple/resource/impl/Fees.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/resource/impl/Manager.cpp b/src/ripple/resource/impl/Manager.cpp index f178438f6..c8f9dc9df 100644 --- a/src/ripple/resource/impl/Manager.cpp +++ b/src/ripple/resource/impl/Manager.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/resource/tests/Logic.test.cpp b/src/ripple/resource/tests/Logic.test.cpp index 984a4bd99..936d7be91 100644 --- a/src/ripple/resource/tests/Logic.test.cpp +++ b/src/ripple/resource/tests/Logic.test.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/rpc/handlers/AccountCurrencies.cpp b/src/ripple/rpc/handlers/AccountCurrencies.cpp index 237c5db60..e0d865bc0 100644 --- a/src/ripple/rpc/handlers/AccountCurrencies.cpp +++ b/src/ripple/rpc/handlers/AccountCurrencies.cpp @@ -17,8 +17,10 @@ */ //============================================================================== +#include #include #include +#include namespace ripple { diff --git a/src/ripple/rpc/handlers/AccountInfo.cpp b/src/ripple/rpc/handlers/AccountInfo.cpp index b541a35c4..b13bccae5 100644 --- a/src/ripple/rpc/handlers/AccountInfo.cpp +++ b/src/ripple/rpc/handlers/AccountInfo.cpp @@ -17,6 +17,8 @@ */ //============================================================================== +#include + namespace ripple { // { diff --git a/src/ripple/rpc/handlers/AccountLines.cpp b/src/ripple/rpc/handlers/AccountLines.cpp index fae3d92d9..638132c0a 100644 --- a/src/ripple/rpc/handlers/AccountLines.cpp +++ b/src/ripple/rpc/handlers/AccountLines.cpp @@ -17,7 +17,9 @@ */ //============================================================================== +#include #include +#include namespace ripple { diff --git a/src/ripple/rpc/handlers/AccountOffers.cpp b/src/ripple/rpc/handlers/AccountOffers.cpp index 66dcae80a..049a8669f 100644 --- a/src/ripple/rpc/handlers/AccountOffers.cpp +++ b/src/ripple/rpc/handlers/AccountOffers.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/rpc/handlers/AccountTx.cpp b/src/ripple/rpc/handlers/AccountTx.cpp index 918a98ad6..95c41ec34 100644 --- a/src/ripple/rpc/handlers/AccountTx.cpp +++ b/src/ripple/rpc/handlers/AccountTx.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/rpc/handlers/AccountTxOld.cpp b/src/ripple/rpc/handlers/AccountTxOld.cpp index 99780cadb..8b99bb23e 100644 --- a/src/ripple/rpc/handlers/AccountTxOld.cpp +++ b/src/ripple/rpc/handlers/AccountTxOld.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/rpc/handlers/AccountTxSwitch.cpp b/src/ripple/rpc/handlers/AccountTxSwitch.cpp index d88f762e0..57f49c5f1 100644 --- a/src/ripple/rpc/handlers/AccountTxSwitch.cpp +++ b/src/ripple/rpc/handlers/AccountTxSwitch.cpp @@ -17,6 +17,8 @@ */ //============================================================================== +#include + namespace ripple { // Temporary switching code until the old account_tx is removed diff --git a/src/ripple/rpc/handlers/BlackList.cpp b/src/ripple/rpc/handlers/BlackList.cpp index 8be993ea7..ab1ed384c 100644 --- a/src/ripple/rpc/handlers/BlackList.cpp +++ b/src/ripple/rpc/handlers/BlackList.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/rpc/handlers/BookOffers.cpp b/src/ripple/rpc/handlers/BookOffers.cpp index 851c6a0ac..10d95dfb8 100644 --- a/src/ripple/rpc/handlers/BookOffers.cpp +++ b/src/ripple/rpc/handlers/BookOffers.cpp @@ -17,6 +17,8 @@ */ //============================================================================== +#include + namespace ripple { Json::Value doBookOffers (RPC::Context& context) diff --git a/src/ripple/rpc/handlers/CanDelete.cpp b/src/ripple/rpc/handlers/CanDelete.cpp index 2e747f5f9..c6e49fe44 100644 --- a/src/ripple/rpc/handlers/CanDelete.cpp +++ b/src/ripple/rpc/handlers/CanDelete.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/rpc/handlers/Connect.cpp b/src/ripple/rpc/handlers/Connect.cpp index 4519daad3..1fcde6808 100644 --- a/src/ripple/rpc/handlers/Connect.cpp +++ b/src/ripple/rpc/handlers/Connect.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/rpc/handlers/ConsensusInfo.cpp b/src/ripple/rpc/handlers/ConsensusInfo.cpp index 37eef8556..ca444e8e8 100644 --- a/src/ripple/rpc/handlers/ConsensusInfo.cpp +++ b/src/ripple/rpc/handlers/ConsensusInfo.cpp @@ -17,6 +17,8 @@ */ //============================================================================== +#include + namespace ripple { Json::Value doConsensusInfo (RPC::Context& context) diff --git a/src/ripple/rpc/handlers/Feature.cpp b/src/ripple/rpc/handlers/Feature.cpp index b1a403af9..5dd03a97b 100644 --- a/src/ripple/rpc/handlers/Feature.cpp +++ b/src/ripple/rpc/handlers/Feature.cpp @@ -17,6 +17,8 @@ */ //============================================================================== +#include +#include namespace ripple { diff --git a/src/ripple/rpc/handlers/FetchInfo.cpp b/src/ripple/rpc/handlers/FetchInfo.cpp index 4680b0e73..89882ba6c 100644 --- a/src/ripple/rpc/handlers/FetchInfo.cpp +++ b/src/ripple/rpc/handlers/FetchInfo.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include namespace ripple { diff --git a/src/ripple/rpc/handlers/GetCounts.cpp b/src/ripple/rpc/handlers/GetCounts.cpp index bc07007da..79665a719 100644 --- a/src/ripple/rpc/handlers/GetCounts.cpp +++ b/src/ripple/rpc/handlers/GetCounts.cpp @@ -17,6 +17,10 @@ */ //============================================================================== +#include +#include +#include +#include #include #include #include diff --git a/src/ripple/rpc/handlers/Internal.cpp b/src/ripple/rpc/handlers/Internal.cpp index 3bf712437..bd40ea6c4 100644 --- a/src/ripple/rpc/handlers/Internal.cpp +++ b/src/ripple/rpc/handlers/Internal.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/rpc/handlers/Ledger.cpp b/src/ripple/rpc/handlers/Ledger.cpp index 0c351fb7a..67fa36e17 100644 --- a/src/ripple/rpc/handlers/Ledger.cpp +++ b/src/ripple/rpc/handlers/Ledger.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/rpc/handlers/LedgerAccept.cpp b/src/ripple/rpc/handlers/LedgerAccept.cpp index 1b401d058..87fbccca3 100644 --- a/src/ripple/rpc/handlers/LedgerAccept.cpp +++ b/src/ripple/rpc/handlers/LedgerAccept.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include namespace ripple { diff --git a/src/ripple/rpc/handlers/LedgerCleaner.cpp b/src/ripple/rpc/handlers/LedgerCleaner.cpp index a5591172b..6aebf773f 100644 --- a/src/ripple/rpc/handlers/LedgerCleaner.cpp +++ b/src/ripple/rpc/handlers/LedgerCleaner.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include namespace ripple { diff --git a/src/ripple/rpc/handlers/LedgerClosed.cpp b/src/ripple/rpc/handlers/LedgerClosed.cpp index f79d7b894..948bd1936 100644 --- a/src/ripple/rpc/handlers/LedgerClosed.cpp +++ b/src/ripple/rpc/handlers/LedgerClosed.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include namespace ripple { diff --git a/src/ripple/rpc/handlers/LedgerCurrent.cpp b/src/ripple/rpc/handlers/LedgerCurrent.cpp index 25ec6759f..37357a658 100644 --- a/src/ripple/rpc/handlers/LedgerCurrent.cpp +++ b/src/ripple/rpc/handlers/LedgerCurrent.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include namespace ripple { diff --git a/src/ripple/rpc/handlers/LedgerData.cpp b/src/ripple/rpc/handlers/LedgerData.cpp index df43de4c7..ff5f66588 100644 --- a/src/ripple/rpc/handlers/LedgerData.cpp +++ b/src/ripple/rpc/handlers/LedgerData.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/rpc/handlers/LedgerEntry.cpp b/src/ripple/rpc/handlers/LedgerEntry.cpp index 16f83b494..bf91d1283 100644 --- a/src/ripple/rpc/handlers/LedgerEntry.cpp +++ b/src/ripple/rpc/handlers/LedgerEntry.cpp @@ -17,6 +17,8 @@ */ //============================================================================== +#include +#include namespace ripple { diff --git a/src/ripple/rpc/handlers/LedgerHeader.cpp b/src/ripple/rpc/handlers/LedgerHeader.cpp index 1c29293f3..c4b4025eb 100644 --- a/src/ripple/rpc/handlers/LedgerHeader.cpp +++ b/src/ripple/rpc/handlers/LedgerHeader.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/rpc/handlers/LedgerRequest.cpp b/src/ripple/rpc/handlers/LedgerRequest.cpp index 55882372f..e1a436b3c 100644 --- a/src/ripple/rpc/handlers/LedgerRequest.cpp +++ b/src/ripple/rpc/handlers/LedgerRequest.cpp @@ -17,6 +17,8 @@ */ //============================================================================== +#include +#include #include namespace ripple { diff --git a/src/ripple/rpc/handlers/LogLevel.cpp b/src/ripple/rpc/handlers/LogLevel.cpp index 6c7ef1999..53ccb2f69 100644 --- a/src/ripple/rpc/handlers/LogLevel.cpp +++ b/src/ripple/rpc/handlers/LogLevel.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/rpc/handlers/LogRotate.cpp b/src/ripple/rpc/handlers/LogRotate.cpp index 4b076fc71..c95417f7d 100644 --- a/src/ripple/rpc/handlers/LogRotate.cpp +++ b/src/ripple/rpc/handlers/LogRotate.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include namespace ripple { diff --git a/src/ripple/rpc/handlers/OwnerInfo.cpp b/src/ripple/rpc/handlers/OwnerInfo.cpp index 3ee1f7b08..9765f8929 100644 --- a/src/ripple/rpc/handlers/OwnerInfo.cpp +++ b/src/ripple/rpc/handlers/OwnerInfo.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include namespace ripple { diff --git a/src/ripple/rpc/handlers/PathFind.cpp b/src/ripple/rpc/handlers/PathFind.cpp index 18eb37be5..ecb05d8f4 100644 --- a/src/ripple/rpc/handlers/PathFind.cpp +++ b/src/ripple/rpc/handlers/PathFind.cpp @@ -17,6 +17,8 @@ */ //============================================================================== +#include +#include namespace ripple { diff --git a/src/ripple/rpc/handlers/Peers.cpp b/src/ripple/rpc/handlers/Peers.cpp index 2d1ec409e..2de1105da 100644 --- a/src/ripple/rpc/handlers/Peers.cpp +++ b/src/ripple/rpc/handlers/Peers.cpp @@ -17,6 +17,8 @@ */ //============================================================================== +#include +#include #include namespace ripple { diff --git a/src/ripple/rpc/handlers/Ping.cpp b/src/ripple/rpc/handlers/Ping.cpp index 477088444..0235783a6 100644 --- a/src/ripple/rpc/handlers/Ping.cpp +++ b/src/ripple/rpc/handlers/Ping.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include namespace ripple { diff --git a/src/ripple/rpc/handlers/Print.cpp b/src/ripple/rpc/handlers/Print.cpp index a1e968c97..291f89df8 100644 --- a/src/ripple/rpc/handlers/Print.cpp +++ b/src/ripple/rpc/handlers/Print.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include namespace ripple { diff --git a/src/ripple/rpc/handlers/Random.cpp b/src/ripple/rpc/handlers/Random.cpp index d4ed196df..a964c8823 100644 --- a/src/ripple/rpc/handlers/Random.cpp +++ b/src/ripple/rpc/handlers/Random.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include diff --git a/src/ripple/rpc/handlers/RipplePathFind.cpp b/src/ripple/rpc/handlers/RipplePathFind.cpp index 8e6874a29..b29e8934d 100644 --- a/src/ripple/rpc/handlers/RipplePathFind.cpp +++ b/src/ripple/rpc/handlers/RipplePathFind.cpp @@ -17,8 +17,10 @@ */ //============================================================================== +#include #include #include +#include #include #include #include diff --git a/src/ripple/rpc/handlers/SMS.cpp b/src/ripple/rpc/handlers/SMS.cpp index 07ad6d91e..8888ee4f0 100644 --- a/src/ripple/rpc/handlers/SMS.cpp +++ b/src/ripple/rpc/handlers/SMS.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/rpc/handlers/ServerInfo.cpp b/src/ripple/rpc/handlers/ServerInfo.cpp index 2bf287684..5457fda86 100644 --- a/src/ripple/rpc/handlers/ServerInfo.cpp +++ b/src/ripple/rpc/handlers/ServerInfo.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/rpc/handlers/ServerState.cpp b/src/ripple/rpc/handlers/ServerState.cpp index b926d3d86..51a9b7729 100644 --- a/src/ripple/rpc/handlers/ServerState.cpp +++ b/src/ripple/rpc/handlers/ServerState.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/rpc/handlers/Sign.cpp b/src/ripple/rpc/handlers/Sign.cpp index a218b8418..e67b94c51 100644 --- a/src/ripple/rpc/handlers/Sign.cpp +++ b/src/ripple/rpc/handlers/Sign.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/rpc/handlers/Stop.cpp b/src/ripple/rpc/handlers/Stop.cpp index b9ae7a5be..fa6997462 100644 --- a/src/ripple/rpc/handlers/Stop.cpp +++ b/src/ripple/rpc/handlers/Stop.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include namespace ripple { diff --git a/src/ripple/rpc/handlers/Submit.cpp b/src/ripple/rpc/handlers/Submit.cpp index 1e632cf94..b5dd55b4c 100644 --- a/src/ripple/rpc/handlers/Submit.cpp +++ b/src/ripple/rpc/handlers/Submit.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include diff --git a/src/ripple/rpc/handlers/Subscribe.cpp b/src/ripple/rpc/handlers/Subscribe.cpp index 8abed0224..549fcab70 100644 --- a/src/ripple/rpc/handlers/Subscribe.cpp +++ b/src/ripple/rpc/handlers/Subscribe.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/rpc/handlers/TransactionEntry.cpp b/src/ripple/rpc/handlers/TransactionEntry.cpp index 0d54fa342..3df8f06f7 100644 --- a/src/ripple/rpc/handlers/TransactionEntry.cpp +++ b/src/ripple/rpc/handlers/TransactionEntry.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include namespace ripple { diff --git a/src/ripple/rpc/handlers/Tx.cpp b/src/ripple/rpc/handlers/Tx.cpp index 3f46fed4f..98f2efba8 100644 --- a/src/ripple/rpc/handlers/Tx.cpp +++ b/src/ripple/rpc/handlers/Tx.cpp @@ -17,6 +17,9 @@ */ //============================================================================== +#include +#include + namespace ripple { // { diff --git a/src/ripple/rpc/handlers/TxHistory.cpp b/src/ripple/rpc/handlers/TxHistory.cpp index 65c22aa62..02f7e5f1b 100644 --- a/src/ripple/rpc/handlers/TxHistory.cpp +++ b/src/ripple/rpc/handlers/TxHistory.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/rpc/handlers/UnlAdd.cpp b/src/ripple/rpc/handlers/UnlAdd.cpp index f478169a4..4d6e33fa0 100644 --- a/src/ripple/rpc/handlers/UnlAdd.cpp +++ b/src/ripple/rpc/handlers/UnlAdd.cpp @@ -17,6 +17,8 @@ */ //============================================================================== +#include +#include namespace ripple { diff --git a/src/ripple/rpc/handlers/UnlDelete.cpp b/src/ripple/rpc/handlers/UnlDelete.cpp index 96df31b76..48ab8b8ba 100644 --- a/src/ripple/rpc/handlers/UnlDelete.cpp +++ b/src/ripple/rpc/handlers/UnlDelete.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include namespace ripple { diff --git a/src/ripple/rpc/handlers/UnlList.cpp b/src/ripple/rpc/handlers/UnlList.cpp index e39023ae6..cdba35937 100644 --- a/src/ripple/rpc/handlers/UnlList.cpp +++ b/src/ripple/rpc/handlers/UnlList.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include namespace ripple { diff --git a/src/ripple/rpc/handlers/UnlLoad.cpp b/src/ripple/rpc/handlers/UnlLoad.cpp index 5fb946c4a..d230ccf5b 100644 --- a/src/ripple/rpc/handlers/UnlLoad.cpp +++ b/src/ripple/rpc/handlers/UnlLoad.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include namespace ripple { diff --git a/src/ripple/rpc/handlers/UnlNetwork.cpp b/src/ripple/rpc/handlers/UnlNetwork.cpp index 0f433d495..511ac0e67 100644 --- a/src/ripple/rpc/handlers/UnlNetwork.cpp +++ b/src/ripple/rpc/handlers/UnlNetwork.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include namespace ripple { diff --git a/src/ripple/rpc/handlers/UnlReset.cpp b/src/ripple/rpc/handlers/UnlReset.cpp index 8cc3ecefa..890e7784d 100644 --- a/src/ripple/rpc/handlers/UnlReset.cpp +++ b/src/ripple/rpc/handlers/UnlReset.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include namespace ripple { diff --git a/src/ripple/rpc/handlers/UnlScore.cpp b/src/ripple/rpc/handlers/UnlScore.cpp index b4f2881af..2da4a7e6b 100644 --- a/src/ripple/rpc/handlers/UnlScore.cpp +++ b/src/ripple/rpc/handlers/UnlScore.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include namespace ripple { diff --git a/src/ripple/rpc/handlers/Unsubscribe.cpp b/src/ripple/rpc/handlers/Unsubscribe.cpp index c826f1576..d14294211 100644 --- a/src/ripple/rpc/handlers/Unsubscribe.cpp +++ b/src/ripple/rpc/handlers/Unsubscribe.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/rpc/handlers/ValidationCreate.cpp b/src/ripple/rpc/handlers/ValidationCreate.cpp index c7af51e91..a7e994cf0 100644 --- a/src/ripple/rpc/handlers/ValidationCreate.cpp +++ b/src/ripple/rpc/handlers/ValidationCreate.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include namespace ripple { diff --git a/src/ripple/rpc/handlers/ValidationSeed.cpp b/src/ripple/rpc/handlers/ValidationSeed.cpp index 3d9759779..fb9b8cf5f 100644 --- a/src/ripple/rpc/handlers/ValidationSeed.cpp +++ b/src/ripple/rpc/handlers/ValidationSeed.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include namespace ripple { diff --git a/src/ripple/rpc/handlers/WalletAccounts.cpp b/src/ripple/rpc/handlers/WalletAccounts.cpp index 06358d391..f41ec845c 100644 --- a/src/ripple/rpc/handlers/WalletAccounts.cpp +++ b/src/ripple/rpc/handlers/WalletAccounts.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include diff --git a/src/ripple/rpc/handlers/WalletPropose.cpp b/src/ripple/rpc/handlers/WalletPropose.cpp index 01bc65456..a60063c57 100644 --- a/src/ripple/rpc/handlers/WalletPropose.cpp +++ b/src/ripple/rpc/handlers/WalletPropose.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include namespace ripple { diff --git a/src/ripple/rpc/handlers/WalletSeed.cpp b/src/ripple/rpc/handlers/WalletSeed.cpp index 38e9a8ef6..0dc4e7750 100644 --- a/src/ripple/rpc/handlers/WalletSeed.cpp +++ b/src/ripple/rpc/handlers/WalletSeed.cpp @@ -17,6 +17,8 @@ */ //============================================================================== +#include + namespace ripple { // { diff --git a/src/ripple/rpc/impl/AccountFromString.cpp b/src/ripple/rpc/impl/AccountFromString.cpp index 23ec825d0..ed7373f2d 100644 --- a/src/ripple/rpc/impl/AccountFromString.cpp +++ b/src/ripple/rpc/impl/AccountFromString.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/rpc/impl/Accounts.cpp b/src/ripple/rpc/impl/Accounts.cpp index d99df993b..4daee3363 100644 --- a/src/ripple/rpc/impl/Accounts.cpp +++ b/src/ripple/rpc/impl/Accounts.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/rpc/impl/Context.h b/src/ripple/rpc/impl/Context.h index 92491ba35..59fbaaa1d 100644 --- a/src/ripple/rpc/impl/Context.h +++ b/src/ripple/rpc/impl/Context.h @@ -21,10 +21,14 @@ #define RIPPLE_RPC_CONTEXT #include +#include #include #include namespace ripple { + +class NetworkOPs; + namespace RPC { /** The context of information needed to call an RPC. */ diff --git a/src/ripple/rpc/impl/Coroutine.cpp b/src/ripple/rpc/impl/Coroutine.cpp index dfa828838..deaa4f52c 100644 --- a/src/ripple/rpc/impl/Coroutine.cpp +++ b/src/ripple/rpc/impl/Coroutine.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include diff --git a/src/ripple/rpc/impl/DoPrint.h b/src/ripple/rpc/impl/DoPrint.h index ab23c27ed..b943e6715 100644 --- a/src/ripple/rpc/impl/DoPrint.h +++ b/src/ripple/rpc/impl/DoPrint.h @@ -20,6 +20,7 @@ #ifndef RIPPLE_RPC_PRINT_H_INCLUDED #define RIPPLE_RPC_PRINT_H_INCLUDED +#include #include namespace ripple { diff --git a/src/ripple/rpc/impl/GetMasterGenerator.cpp b/src/ripple/rpc/impl/GetMasterGenerator.cpp index ce36ffd17..8e2174ec7 100644 --- a/src/ripple/rpc/impl/GetMasterGenerator.cpp +++ b/src/ripple/rpc/impl/GetMasterGenerator.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/rpc/impl/Handler.cpp b/src/ripple/rpc/impl/Handler.cpp index 6d632f844..535757c51 100644 --- a/src/ripple/rpc/impl/Handler.cpp +++ b/src/ripple/rpc/impl/Handler.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include diff --git a/src/ripple/rpc/impl/JsonObject.cpp b/src/ripple/rpc/impl/JsonObject.cpp index 0f5fb74a6..778778a6a 100644 --- a/src/ripple/rpc/impl/JsonObject.cpp +++ b/src/ripple/rpc/impl/JsonObject.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/rpc/impl/JsonWriter.cpp b/src/ripple/rpc/impl/JsonWriter.cpp index 76c295c07..ab73d5874 100644 --- a/src/ripple/rpc/impl/JsonWriter.cpp +++ b/src/ripple/rpc/impl/JsonWriter.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/rpc/impl/LegacyPathFind.cpp b/src/ripple/rpc/impl/LegacyPathFind.cpp index 81aed226d..5e6025132 100644 --- a/src/ripple/rpc/impl/LegacyPathFind.cpp +++ b/src/ripple/rpc/impl/LegacyPathFind.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include diff --git a/src/ripple/rpc/impl/LookupLedger.cpp b/src/ripple/rpc/impl/LookupLedger.cpp index d12c908df..8b5bf3aaf 100644 --- a/src/ripple/rpc/impl/LookupLedger.cpp +++ b/src/ripple/rpc/impl/LookupLedger.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/rpc/impl/Manager.cpp b/src/ripple/rpc/impl/Manager.cpp index b5dd9a3e4..eecb382e4 100644 --- a/src/ripple/rpc/impl/Manager.cpp +++ b/src/ripple/rpc/impl/Manager.cpp @@ -17,10 +17,10 @@ */ //============================================================================== -#include - +#include #include #include +#include namespace ripple { namespace RPC { diff --git a/src/ripple/rpc/impl/ParseAccountIds.cpp b/src/ripple/rpc/impl/ParseAccountIds.cpp index 90d6d551b..8b8ce4559 100644 --- a/src/ripple/rpc/impl/ParseAccountIds.cpp +++ b/src/ripple/rpc/impl/ParseAccountIds.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/rpc/impl/RPCHandler.cpp b/src/ripple/rpc/impl/RPCHandler.cpp index 3e8ff7224..f189a1419 100644 --- a/src/ripple/rpc/impl/RPCHandler.cpp +++ b/src/ripple/rpc/impl/RPCHandler.cpp @@ -17,22 +17,24 @@ */ //============================================================================== -#include -#include -#include -#include -#include +#include #include #include #include #include #include #include - -#include +#include +#include +#include #include +#include +#include #include +#include +#include #include +#include namespace ripple { namespace RPC { diff --git a/src/ripple/rpc/impl/Status.cpp b/src/ripple/rpc/impl/Status.cpp index 0cf38a814..1e415fb54 100644 --- a/src/ripple/rpc/impl/Status.cpp +++ b/src/ripple/rpc/impl/Status.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/rpc/impl/TransactionSign.cpp b/src/ripple/rpc/impl/TransactionSign.cpp index d049c9732..1ea5d1b4d 100644 --- a/src/ripple/rpc/impl/TransactionSign.cpp +++ b/src/ripple/rpc/impl/TransactionSign.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/rpc/impl/WriteJson.cpp b/src/ripple/rpc/impl/WriteJson.cpp index c49bbe259..700870b5b 100644 --- a/src/ripple/rpc/impl/WriteJson.cpp +++ b/src/ripple/rpc/impl/WriteJson.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include diff --git a/src/ripple/rpc/impl/Yield.cpp b/src/ripple/rpc/impl/Yield.cpp index 156961fff..a462c6da4 100644 --- a/src/ripple/rpc/impl/Yield.cpp +++ b/src/ripple/rpc/impl/Yield.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include diff --git a/src/ripple/rpc/tests/Coroutine.test.cpp b/src/ripple/rpc/tests/Coroutine.test.cpp index 2da9fe8c1..decb975db 100644 --- a/src/ripple/rpc/tests/Coroutine.test.cpp +++ b/src/ripple/rpc/tests/Coroutine.test.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/rpc/tests/JSONRPC.test.cpp b/src/ripple/rpc/tests/JSONRPC.test.cpp index c53b125ba..1578b95ee 100644 --- a/src/ripple/rpc/tests/JSONRPC.test.cpp +++ b/src/ripple/rpc/tests/JSONRPC.test.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/rpc/tests/JsonObject.test.cpp b/src/ripple/rpc/tests/JsonObject.test.cpp index 9e21cbab5..1ffce978c 100644 --- a/src/ripple/rpc/tests/JsonObject.test.cpp +++ b/src/ripple/rpc/tests/JsonObject.test.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/rpc/tests/JsonWriter.test.cpp b/src/ripple/rpc/tests/JsonWriter.test.cpp index 7afa48f69..db4900b66 100644 --- a/src/ripple/rpc/tests/JsonWriter.test.cpp +++ b/src/ripple/rpc/tests/JsonWriter.test.cpp @@ -17,8 +17,8 @@ */ //============================================================================== +#include #include - #include #include #include diff --git a/src/ripple/rpc/tests/Status.test.cpp b/src/ripple/rpc/tests/Status.test.cpp index 7f81f2525..ea2d3c1d8 100644 --- a/src/ripple/rpc/tests/Status.test.cpp +++ b/src/ripple/rpc/tests/Status.test.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include diff --git a/src/ripple/rpc/tests/WriteJson.test.cpp b/src/ripple/rpc/tests/WriteJson.test.cpp index ceed97d16..2d930f4bb 100644 --- a/src/ripple/rpc/tests/WriteJson.test.cpp +++ b/src/ripple/rpc/tests/WriteJson.test.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include diff --git a/src/ripple/rpc/tests/Yield.test.cpp b/src/ripple/rpc/tests/Yield.test.cpp index 369973099..b1d117d90 100644 --- a/src/ripple/rpc/tests/Yield.test.cpp +++ b/src/ripple/rpc/tests/Yield.test.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include diff --git a/src/ripple/server/impl/Door.cpp b/src/ripple/server/impl/Door.cpp index 2a929d6f8..17633cdd4 100644 --- a/src/ripple/server/impl/Door.cpp +++ b/src/ripple/server/impl/Door.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/server/impl/JSONRPCUtil.cpp b/src/ripple/server/impl/JSONRPCUtil.cpp index 5afb122d7..af6b83d9b 100644 --- a/src/ripple/server/impl/JSONRPCUtil.cpp +++ b/src/ripple/server/impl/JSONRPCUtil.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/server/impl/Role.cpp b/src/ripple/server/impl/Role.cpp index 37f0b4a2c..52db64036 100644 --- a/src/ripple/server/impl/Role.cpp +++ b/src/ripple/server/impl/Role.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/server/impl/ServerHandlerImp.cpp b/src/ripple/server/impl/ServerHandlerImp.cpp index 65d2dbd38..42267f41e 100644 --- a/src/ripple/server/impl/ServerHandlerImp.cpp +++ b/src/ripple/server/impl/ServerHandlerImp.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/server/impl/ServerImpl.cpp b/src/ripple/server/impl/ServerImpl.cpp index 0c80e348e..310a896d4 100644 --- a/src/ripple/server/impl/ServerImpl.cpp +++ b/src/ripple/server/impl/ServerImpl.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/server/tests/Server.test.cpp b/src/ripple/server/tests/Server.test.cpp index a5f9703f7..2ad7abb35 100644 --- a/src/ripple/server/tests/Server.test.cpp +++ b/src/ripple/server/tests/Server.test.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/shamap/impl/SHAMap.cpp b/src/ripple/shamap/impl/SHAMap.cpp index 6ca9a5d83..0f36f8d32 100644 --- a/src/ripple/shamap/impl/SHAMap.cpp +++ b/src/ripple/shamap/impl/SHAMap.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/shamap/impl/SHAMapDelta.cpp b/src/ripple/shamap/impl/SHAMapDelta.cpp index 2edd5f144..38d79dd57 100644 --- a/src/ripple/shamap/impl/SHAMapDelta.cpp +++ b/src/ripple/shamap/impl/SHAMapDelta.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/shamap/impl/SHAMapItem.cpp b/src/ripple/shamap/impl/SHAMapItem.cpp index f2e2ff2cf..7bc265e6e 100644 --- a/src/ripple/shamap/impl/SHAMapItem.cpp +++ b/src/ripple/shamap/impl/SHAMapItem.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/shamap/impl/SHAMapMissingNode.cpp b/src/ripple/shamap/impl/SHAMapMissingNode.cpp index 2563d7730..f0af9944a 100644 --- a/src/ripple/shamap/impl/SHAMapMissingNode.cpp +++ b/src/ripple/shamap/impl/SHAMapMissingNode.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include diff --git a/src/ripple/shamap/impl/SHAMapNodeID.cpp b/src/ripple/shamap/impl/SHAMapNodeID.cpp index 0e708973d..18577cea9 100644 --- a/src/ripple/shamap/impl/SHAMapNodeID.cpp +++ b/src/ripple/shamap/impl/SHAMapNodeID.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/shamap/impl/SHAMapSync.cpp b/src/ripple/shamap/impl/SHAMapSync.cpp index 5f31d8975..ee101b668 100644 --- a/src/ripple/shamap/impl/SHAMapSync.cpp +++ b/src/ripple/shamap/impl/SHAMapSync.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/shamap/impl/SHAMapTreeNode.cpp b/src/ripple/shamap/impl/SHAMapTreeNode.cpp index 828ffb179..9688c99f7 100644 --- a/src/ripple/shamap/impl/SHAMapTreeNode.cpp +++ b/src/ripple/shamap/impl/SHAMapTreeNode.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/shamap/tests/FetchPack.test.cpp b/src/ripple/shamap/tests/FetchPack.test.cpp index 3498a9138..527cb36f4 100644 --- a/src/ripple/shamap/tests/FetchPack.test.cpp +++ b/src/ripple/shamap/tests/FetchPack.test.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/shamap/tests/SHAMap.test.cpp b/src/ripple/shamap/tests/SHAMap.test.cpp index 889a9a1f8..fab01be99 100644 --- a/src/ripple/shamap/tests/SHAMap.test.cpp +++ b/src/ripple/shamap/tests/SHAMap.test.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/shamap/tests/SHAMapSync.test.cpp b/src/ripple/shamap/tests/SHAMapSync.test.cpp index b1171269d..03e05792e 100644 --- a/src/ripple/shamap/tests/SHAMapSync.test.cpp +++ b/src/ripple/shamap/tests/SHAMapSync.test.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/unity/app.cpp b/src/ripple/unity/app.cpp index a01e174e2..cf7541431 100644 --- a/src/ripple/unity/app.cpp +++ b/src/ripple/unity/app.cpp @@ -18,9 +18,7 @@ //============================================================================== #include - #include -#include #include #include #include @@ -33,66 +31,3 @@ #include #include #include - -//------------------------------------------------------------------------------ - -namespace ripple { -int run (int argc, char** argv); -} - -struct ProtobufLibrary -{ - ~ProtobufLibrary () - { - google::protobuf::ShutdownProtobufLibrary(); - } -}; - -// Must be outside the namespace for obvious reasons -// -int main (int argc, char** argv) -{ - // Workaround for Boost.Context / Boost.Coroutine - // https://svn.boost.org/trac/boost/ticket/10657 - (void)beast::Time::currentTimeMillis(); - -#if defined(__GNUC__) && !defined(__clang__) - auto constexpr gccver = (__GNUC__ * 100 * 100) + - (__GNUC_MINOR__ * 100) + - __GNUC_PATCHLEVEL__; - - static_assert (gccver >= 40801, - "GCC version 4.8.1 or later is required to compile rippled."); -#endif - - static_assert (BOOST_VERSION >= 105500, - "Boost version 1.55 or later is required to compile rippled"); - - // - // These debug heap calls do nothing in release or non Visual Studio builds. - // - - // Checks the heap at every allocation and deallocation (slow). - // - //beast::Debug::setAlwaysCheckHeap (false); - - // Keeps freed memory blocks and fills them with a guard value. - // - //beast::Debug::setHeapDelayedFree (false); - - // At exit, reports all memory blocks which have not been freed. - // -#if RIPPLE_DUMP_LEAKS_ON_EXIT - beast::Debug::setHeapReportLeaks (true); -#else - beast::Debug::setHeapReportLeaks (false); -#endif - - beast::SharedSingleton ::get (); - - auto const result (ripple::run (argc, argv)); - - beast::basic_seconds_clock_main_hook(); - - return result; -} diff --git a/src/ripple/unity/app.h b/src/ripple/unity/app.h deleted file mode 100644 index f87e94b4b..000000000 --- a/src/ripple/unity/app.h +++ /dev/null @@ -1,91 +0,0 @@ -//------------------------------------------------------------------------------ -/* - This file is part of rippled: https://github.com/ripple/rippled - Copyright (c) 2012, 2013 Ripple Labs - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ -//============================================================================== - -#ifndef RIPPLE_APP_H_INCLUDED -#define RIPPLE_APP_H_INCLUDED - -#if BEAST_LINUX || BEAST_MAC || BEAST_BSD -#include -#endif - -#include - -// VFALCO TODO Remove this include -#include - -// Order matters here. If you get compile errors, -// reorder the include lines until the order is correct. - -#include -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#endif diff --git a/src/ripple/unity/app2.cpp b/src/ripple/unity/app2.cpp index 92e783d52..5c4a47d24 100644 --- a/src/ripple/unity/app2.cpp +++ b/src/ripple/unity/app2.cpp @@ -19,8 +19,6 @@ #include -#include - #include #include #include diff --git a/src/ripple/unity/app3.cpp b/src/ripple/unity/app3.cpp index 52be7547b..dc7973d6e 100644 --- a/src/ripple/unity/app3.cpp +++ b/src/ripple/unity/app3.cpp @@ -19,8 +19,6 @@ #include -#include - #include #include #include diff --git a/src/ripple/unity/app4.cpp b/src/ripple/unity/app4.cpp index f2653b883..6355f7163 100644 --- a/src/ripple/unity/app4.cpp +++ b/src/ripple/unity/app4.cpp @@ -19,8 +19,6 @@ #include -#include - #include #include #include diff --git a/src/ripple/unity/app5.cpp b/src/ripple/unity/app5.cpp index b5e639bcf..4245ac22e 100644 --- a/src/ripple/unity/app5.cpp +++ b/src/ripple/unity/app5.cpp @@ -19,8 +19,6 @@ #include -#include - #include #include #include diff --git a/src/ripple/unity/app6.cpp b/src/ripple/unity/app6.cpp index d4a4b21a3..3ba308382 100644 --- a/src/ripple/unity/app6.cpp +++ b/src/ripple/unity/app6.cpp @@ -19,8 +19,6 @@ #include -#include - #include #include #include diff --git a/src/ripple/unity/app7.cpp b/src/ripple/unity/app7.cpp index f6b2ff536..5867e6416 100644 --- a/src/ripple/unity/app7.cpp +++ b/src/ripple/unity/app7.cpp @@ -19,8 +19,6 @@ #include -#include - #include #include #include diff --git a/src/ripple/unity/app8.cpp b/src/ripple/unity/app8.cpp index ea1ad59da..e0214942e 100644 --- a/src/ripple/unity/app8.cpp +++ b/src/ripple/unity/app8.cpp @@ -19,8 +19,6 @@ #include -#include - #ifdef _MSC_VER #pragma warning (push) #pragma warning (disable: 4309) // truncation of constant value @@ -41,7 +39,6 @@ #include #include -#include #include #ifdef _MSC_VER diff --git a/src/ripple/unity/app9.cpp b/src/ripple/unity/app9.cpp index 7c257a8e7..5e688b25d 100644 --- a/src/ripple/unity/app9.cpp +++ b/src/ripple/unity/app9.cpp @@ -19,8 +19,6 @@ #include -#include - #include #include #include diff --git a/src/ripple/unity/basics.cpp b/src/ripple/unity/basics.cpp index 98c58cfcc..f217d0015 100644 --- a/src/ripple/unity/basics.cpp +++ b/src/ripple/unity/basics.cpp @@ -17,10 +17,6 @@ */ //============================================================================== -#if DOXYGEN -#include -#endif - #include #include @@ -43,3 +39,7 @@ #include #include #include + +#if DOXYGEN +#include +#endif diff --git a/src/ripple/unity/crypto.cpp b/src/ripple/unity/crypto.cpp index 0f0fc75e1..aaa0e5854 100644 --- a/src/ripple/unity/crypto.cpp +++ b/src/ripple/unity/crypto.cpp @@ -17,10 +17,6 @@ */ //============================================================================== -#if DOXYGEN -#include -#endif - #include #include @@ -37,3 +33,7 @@ #include #include + +#if DOXYGEN +#include +#endif diff --git a/src/ripple/unity/net.cpp b/src/ripple/unity/net.cpp index 4c6021e58..3726c1213 100644 --- a/src/ripple/unity/net.cpp +++ b/src/ripple/unity/net.cpp @@ -17,17 +17,10 @@ */ //============================================================================== -/** Add this to get the @ref ripple_net module. - - @file ripple_net.cpp - @ingroup ripple_net -*/ - #undef DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER #define DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER /**/ #include - #include #include #include diff --git a/src/ripple/unity/nodestore.cpp b/src/ripple/unity/nodestore.cpp index d8407468e..da0bd13a5 100644 --- a/src/ripple/unity/nodestore.cpp +++ b/src/ripple/unity/nodestore.cpp @@ -17,13 +17,7 @@ */ //============================================================================== -//#include -//#include - -// backend support -#include -#include -#include +#include #include #include diff --git a/src/ripple/unity/overlay.cpp b/src/ripple/unity/overlay.cpp index c5edf04d2..242088957 100644 --- a/src/ripple/unity/overlay.cpp +++ b/src/ripple/unity/overlay.cpp @@ -17,10 +17,6 @@ */ //============================================================================== -#if DOXYGEN -#include -#endif - #include #include @@ -32,3 +28,6 @@ #include #include +#if DOXYGEN +#include +#endif diff --git a/src/ripple/unity/peerfinder.cpp b/src/ripple/unity/peerfinder.cpp index a87ac7bce..0e9906d2e 100644 --- a/src/ripple/unity/peerfinder.cpp +++ b/src/ripple/unity/peerfinder.cpp @@ -17,10 +17,6 @@ */ //============================================================================== -#if DOXYGEN -#include -#endif - #include #ifndef NDEBUG @@ -30,7 +26,7 @@ #endif #include -#include +#include #include #include #include @@ -46,3 +42,7 @@ #include #include + +#if DOXYGEN +#include +#endif diff --git a/src/ripple/unity/protocol.cpp b/src/ripple/unity/protocol.cpp index e4464dc88..c7693f6de 100644 --- a/src/ripple/unity/protocol.cpp +++ b/src/ripple/unity/protocol.cpp @@ -19,10 +19,6 @@ #include -#if DOXYGEN -#include -#endif - #include #include #include @@ -58,3 +54,7 @@ #include #include #include + +#if DOXYGEN +#include +#endif diff --git a/src/ripple/unity/resource.cpp b/src/ripple/unity/resource.cpp index 7c165dcf6..d4f2fd08a 100644 --- a/src/ripple/unity/resource.cpp +++ b/src/ripple/unity/resource.cpp @@ -17,10 +17,6 @@ */ //============================================================================== -#if DOXYGEN -#include -#endif - #include #include @@ -30,5 +26,8 @@ #include #include #include - #include + +#if DOXYGEN +#include +#endif diff --git a/src/ripple/unity/rpcx.cpp b/src/ripple/unity/rpcx.cpp index 582084273..e05e0a386 100644 --- a/src/ripple/unity/rpcx.cpp +++ b/src/ripple/unity/rpcx.cpp @@ -19,8 +19,9 @@ #include -// Unfortunate but necessary since RPC handlers can literally do anything -#include +// This has to be included early to prevent an obscure MSVC compile error +#include + #include #include diff --git a/src/ripple/unity/shamap.cpp b/src/ripple/unity/shamap.cpp index 0ad0c92cd..ee1ec32d9 100644 --- a/src/ripple/unity/shamap.cpp +++ b/src/ripple/unity/shamap.cpp @@ -18,7 +18,6 @@ //============================================================================== #include - #include #include #include @@ -26,7 +25,6 @@ #include #include #include - #include #include #include diff --git a/src/ripple/unity/validators.cpp b/src/ripple/unity/validators.cpp index a8728f621..b0e246f2c 100644 --- a/src/ripple/unity/validators.cpp +++ b/src/ripple/unity/validators.cpp @@ -18,10 +18,8 @@ //============================================================================== #include - #include #include #include #include - #include diff --git a/src/ripple/validators/impl/ConnectionImp.cpp b/src/ripple/validators/impl/ConnectionImp.cpp index 716d1c8a8..b8902a844 100644 --- a/src/ripple/validators/impl/ConnectionImp.cpp +++ b/src/ripple/validators/impl/ConnectionImp.cpp @@ -17,13 +17,11 @@ */ //============================================================================== +#include #include namespace ripple { namespace Validators { - - - } } diff --git a/src/ripple/validators/impl/Logic.cpp b/src/ripple/validators/impl/Logic.cpp index b69742a28..1e558ec9c 100644 --- a/src/ripple/validators/impl/Logic.cpp +++ b/src/ripple/validators/impl/Logic.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include diff --git a/src/ripple/validators/impl/Manager.cpp b/src/ripple/validators/impl/Manager.cpp index 47825f483..0b4568057 100644 --- a/src/ripple/validators/impl/Manager.cpp +++ b/src/ripple/validators/impl/Manager.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/validators/impl/StoreSqdb.cpp b/src/ripple/validators/impl/StoreSqdb.cpp index 12e39b739..ed97d49ad 100644 --- a/src/ripple/validators/impl/StoreSqdb.cpp +++ b/src/ripple/validators/impl/StoreSqdb.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include #include #include diff --git a/src/ripple/validators/tests/Validators.test.cpp b/src/ripple/validators/tests/Validators.test.cpp index 8233d3381..f8ee94476 100644 --- a/src/ripple/validators/tests/Validators.test.cpp +++ b/src/ripple/validators/tests/Validators.test.cpp @@ -17,6 +17,7 @@ */ //============================================================================== +#include #include namespace ripple { diff --git a/src/ripple/websocket/autosocket/AutoSocket.cpp b/src/ripple/websocket/autosocket/AutoSocket.cpp index b52889995..060c84727 100644 --- a/src/ripple/websocket/autosocket/AutoSocket.cpp +++ b/src/ripple/websocket/autosocket/AutoSocket.cpp @@ -17,4 +17,6 @@ */ //============================================================================== +#include + // VFALCO - Empty file? diff --git a/src/ripple/websocket/autosocket/LogWebsockets.cpp b/src/ripple/websocket/autosocket/LogWebsockets.cpp index 795cbcc08..a9afb46c6 100644 --- a/src/ripple/websocket/autosocket/LogWebsockets.cpp +++ b/src/ripple/websocket/autosocket/LogWebsockets.cpp @@ -17,6 +17,8 @@ */ //============================================================================== +#include + // VFALCO NOTE this looks like some facility for giving websocket // a way to produce logging output. //