diff --git a/Builds/VisualStudio2013/RippleD.vcxproj b/Builds/VisualStudio2013/RippleD.vcxproj index 04b96c5652..cfd9a38ace 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 f189a8a698..4683f393bc 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 b5d46701a5..de59a8100e 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 0059908fbc..af949b010a 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 8afbefaf78..6750d3f1f2 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 db324fb1f7..a905ae1cd2 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 c418f09a46..8a1f9bde07 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 9b510af4e7..c1abc1bc5e 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 431e569343..1884c9eb0e 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 fd8f305c3d..e4606d66fc 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 6ed67f6160..f1f64c302f 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 231edd4d7e..7f431453f4 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 772f89e375..d611a6afc6 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 b97b3d89b5..ee3a9f3b12 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 78071626d7..d605c2f130 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 95f1bf0f7f..b13ad94435 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 3954c3394a..d72231e20e 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 f7695ccac3..7adbbc2788 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 664057c6f4..aca6c7def1 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 8e65069d02..d7318ae287 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 c383571ed7..ff1201ebb5 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 25bf4638f7..639703ea46 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 748eaae1b3..a3ee78f4d5 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 0177ae03d5..187ee0c36e 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 d4e9121540..7ef576a1d8 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 9784c36ccf..c4edc29cd3 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 7657f282b7..dac8e679a2 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 da1a5cd907..eaa59e9ad0 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 47e89eeb68..9998eb988a 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 7a1e28ccc5..0fa87d730d 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 7152164a42..6f5788b76d 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 c33845378b..8689f03ce4 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 593c2823c1..f9670adfa3 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 36badfaca5..b532ca7bb0 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 a35a9334d0..73aa15f1f9 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 90c35c1044..11ab90312b 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 794f5d188c..177ed71711 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 cc1d816755..61ac908636 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 b3625374d5..4fddf33afa 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 f833ad32be..e34d07e50c 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 061b7aea99..28a1b97c70 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 663eed7a0d..cd5f733308 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 850d220c7f..f7e331d0de 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 d060ffe1ca..9fd843476f 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 c0a57da0b1..229b1e8ebc 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 c5d0abdbff..6ff9d21f86 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 e2478e8de1..3bc1a6afd2 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 e29bf30df7..1f91444c13 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 0f6bdebb23..fd41000147 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 913a6e1e28..af83add86e 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 306ea1ba9b..e563582c55 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 2b32ceb180..5e5d2cfd34 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 5ef961f1be..de4a66b1db 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 36ada486d2..be24ea8833 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 f942c5b93c..a2e482b72f 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 67a9b68d22..4b2186bf11 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 2f5533f429..117a322af0 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 2a0ae9c971..0000000000 --- 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 e80cfda2bf..0000000000 --- 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 45d3bbe782..b54ebffe02 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 2506c6691b..e0a594a5b7 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 8cb7b34361..75da35b182 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 f2be1614a8..f5f0cfa353 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 ec3468dbd6..e028d9d059 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 791b182652..4f30507d5e 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 d4694ff2b0..1c85662281 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 b59f3c5d7a..6a51881387 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 e9aa8af250..fc9e067126 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 a3cacfac15..3f36860161 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 7a1f03f36b..fa26e2b4d1 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 40be2f5976..fb0879ad89 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 377f511597..320e5591d8 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 d4d09efba8..02b51a51a9 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 e2a83381ef..b4dfb627fa 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 f26da6bcef..05de97c7ed 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 cd7d776ee2..2610ac1259 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 139dabf113..39026f6e9d 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 627c52adb0..207fc34759 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 55e475b176..e8f536818c 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 65b67f3655..e0ba4b45e2 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 374d6184bc..4bfd254b0a 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 dc71229737..83feebc5fe 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 833a08fa16..df5cd7e6d7 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 50357dcf1a..a3660786ca 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 b1f5f99bf8..67870ab131 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 e33fdc4dfa..40a1a32438 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 9060988796..a972452c15 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 74c630c505..0042929a39 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 a03d26febd..a76c0b072a 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 323458173d..7c48c928a9 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 3046a1df1c..9e18710781 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 44f09a4e34..0c2e8e71d3 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 89652b3fbe..6ec05a7ae5 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 7374518a5b..b17fade396 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 7669a9b952..36a22d5529 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 b4d54c5eca..6f7ebf2452 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 f7d4063f6e..df6e82449e 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 207ccfe476..702de7ff60 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 ba13d43c59..a29d998d75 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 2d8822bc46..6ec36e3ae6 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 4901bed24a..8b6f5bad44 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 e411fc2036..d20a0331f5 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 e5272979c5..c7c2a78e80 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 0ecfea4acf..6c8b93300a 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 73fa506c00..c16f539402 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 d458980d17..0a9c7c09cd 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 1969c72f59..c5491e2403 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 47f35a78e5..d3edca127b 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 8a69655df6..ab3de7f441 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 2ac3901c3d..74e408bb6d 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 8276983ef7..7e746b7e34 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 56f7d0d0d1..7f60edace6 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 55889373fc..6602a9f0ff 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 7d04e57df1..624c75c33d 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 444d802ece..bea3c5aa93 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 0000000000..e51aaf7a14 --- /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 62c786a61b..06cc24bd06 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 f1eda6bb65..3b44dd9a27 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 30d61580e2..4445d908cc 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 9e7dd6fdd2..514e9de4b4 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 f04634a499..85337a85ee 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 97a98d5360..5f2d53d99b 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 cdc499c931..bb751082bf 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 1e4fee0c94..e7cf9d210c 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 826490646e..db1655e9a3 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 85b1371b89..1a97f9ce3e 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 8c7f83ec52..e2236ce496 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 4c80895da6..1b2767442b 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 8b4caa6fec..e3ed402837 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 494021c576..82478524c8 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 326dcba11f..59240054d5 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 445a09a8b2..f511ac62c9 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 c37c662837..0547edc1d0 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 91b111de46..b12db2dbd2 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 3e12331478..c0041d09b5 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 2ba9ac3145..dd3439305b 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 4c8847263e..b808d7991d 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 6a0e6050a0..fc2c412149 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 65ff6988ea..e517246033 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 3224077ec9..acfd958eab 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 02c4bc601a..53ae18e9c5 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 f286d350d9..bedf4a2f08 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 76f6fb56d4..7a999905d7 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 faf13942a2..5d2c1d3ccd 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 e4a7d3449b..539cc62df1 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 eab74572dd..3420ec7d10 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 e1de28fa5f..48ae2828b6 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 af415a43dc..76af616f7d 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 5ac79444ec..96ed6782ec 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 e64287c6c1..741680b535 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 d1f62363b9..000eae77aa 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 49c2c56085..af9133b4de 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 1385f9e728..72a0d0a77e 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 3e49e079b2..1488ed2dee 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 25e855b0d4..965ca6809d 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 2f8b48cf5c..87a3bfbab2 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 b275460390..e09444f3c1 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 832dc38b5d..25c81240d9 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 00176ea5e6..602400b05a 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 c776372b13..cbda78d421 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 19da732a8b..648b8fd028 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 c0afda65c0..b31d579754 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 48499854be..4f5b4447d3 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 6aec69c87e..4070c0920a 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 82f0588264..90bf2ccdd0 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 c28c8a45d3..10849d26ae 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 5a8dce0394..dc39c5a201 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 92f18f71a4..2d49bcccbc 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 012afb27ea..5b0a61838f 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 b16fc4eb24..adcbb2908f 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 4b6800de0f..5c7c6fbc2a 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 47f0d351e9..d17b6e95e6 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 28059ab700..7f71214e1c 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 629434b1e0..3f7e731c13 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 a6dadfb546..66ad596ab5 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 44495119ec..6b8bb974f5 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 ca7d4fcc7f..797159e0f2 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 8b7275ba06..16ea357a63 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 68273f30b8..5f792dd512 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 98434df68c..4ea82d4817 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 5abd654a29..877e2cfcd7 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 ed120d4c18..6d9d69333c 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 04377c782d..785203a180 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 631de1f740..87546f5a7b 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 0000000000..ab1d5ef12d --- /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 abdf5e2cea..5c789e2bc0 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 02e96b6354..c8e3ad0cdf 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 50d7009fba..8852a7efb2 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 1b173a2266..f610a06b13 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 153052e256..80c324e7c7 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 c6fbf977fd..a0bea19a0f 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 db70d5856f..5406467b3d 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 a91f1bf863..6bea694577 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 47ccd4cc6e..e382b35da1 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 c8cc481619..04c384fb7a 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 5099738828..1d85ffe4b7 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 4f7122357e..bb695b98e9 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 34e8ab210c..9f590ed76a 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 294e1f8287..54d34d9834 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 c5a50e4f77..7a0a54cab3 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 9fe42452d5..6f72af4531 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 080b4bef68..1dc6af52f5 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 43203687b9..9cab5b3e38 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 9b27bc4ad5..af7bdf293d 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 3246aaf20c..478e42fbbe 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 03dd800e11..c13edb633d 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 6716a74e95..89ce6d6ece 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 eab59e258a..96921ca9d4 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 a8fa0e93c4..c607503daf 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 58d9d353cb..ab4b04bd19 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 56183fec4e..559fd7da23 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 9e67f1f6f9..24a27c3e58 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 3842d6df7e..106c814bf6 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 f947186a26..36b8a0aade 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 be4b4d480c..d90c0ca2da 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 7faf511ee0..db9fbfa4b6 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 e8a9a7a022..f45da06eae 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 83df409001..9ee8dc34f3 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 9175eb48d9..3348fb43e5 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 a15c8183d3..cbefd8f4fd 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 3bf5162316..0ee219136c 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 df0aa9a4ac..06820139a7 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 833655a1a9..41a16d2e2e 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 851ecf4404..947bc5bc74 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 4bedcf394c..d751cb6cf1 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 f4cf54b5d0..676985a7bc 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 82927387d8..75eee1bccf 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 46404cca31..8807ed7e2a 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 a71ea280be..dd9b79d023 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 aa68278a8b..94506ab6e1 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 04d25dcb61..780f2a399f 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 8570672f88..7d6cdd0a3a 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 099111e47f..4e87d36ceb 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 07acd8c9af..b2656a3bb4 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 99835e1a09..d5d92d8339 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 98e2b2f5fc..6cb2b05914 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 61021ffa78..3ec935b687 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 d46a3260e5..4f10d14465 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 ca10461e91..32f9cbca60 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 de95bacf40..fcffb9ad8a 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 4354f90ff9..2adc357d6b 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 9028b66a5b..8aca7b5857 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 96a84d5724..98aa521d11 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 d24a564544..b961b46b57 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 839e11a0d6..06849c468f 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 0b0265826b..62916019e3 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 cae3fcfdd4..4152a889ce 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 3738152207..211a7cc097 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 b900b8a2d3..29068dbba3 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 8619dce899..9a14047fd4 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 10e1e39235..0d7cda8e0f 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 0b5a2bf02c..a0c3d09359 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 60ef7abf31..54a43ddaa6 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 4e4b1f0d4a..440298cbef 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 4cda1a8320..393e63a9b1 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 b86a7b8b77..7eb2b2bac3 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 b8ac4a4475..50302ea225 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 48a0dff6ba..f19336c5f6 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 2403933df7..10f140c8a6 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 fcca8790bc..28049d16d9 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 f03e81e797..47e6eb07ca 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 1537392132..c5cc0ce285 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 523c143285..cdc8753f94 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 ab9c9d2306..41045eebf2 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 e9d9dda3f6..37049d5aba 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 933f4f0a0a..2e7194746b 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 8f5026dad3..72da163baf 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 6cbf438e1a..8470062649 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 683d1693a5..6c6b026a37 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 f7f4dc7528..d2a175a62b 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 922bfed2bb..d0c9bff907 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 62cad689e9..9633216229 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 f151f71cbd..56cfe50b74 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 7ab5645300..718778b38e 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 e5f4893541..7ed9251632 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 f61cc79cf1..0c7bf9df11 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 5b8dc9050f..ce59232071 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 d1265079d6..f21d6fd854 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 f18385602b..80e958023d 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 705a789ce1..f267e89ded 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 e64621eaab..3ae89ace08 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 40b5656b6b..5009a97c72 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 a2f191d21d..8c15d622a7 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 cad0983505..8d305452b8 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 f178438f6a..c8f9dc9df5 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 984a4bd99e..936d7be91e 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 237c5db605..e0d865bc04 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 b541a35c4d..b13bccae51 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 fae3d92d9f..638132c0a8 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 66dcae80ad..049a8669f0 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 918a98ad66..95c41ec34a 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 99780cadb4..8b99bb23eb 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 d88f762e02..57f49c5f11 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 8be993ea78..ab1ed384c7 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 851c6a0ac8..10d95dfb87 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 2e747f5f9c..c6e49fe44d 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 4519daad30..1fcde68087 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 37eef85566..ca444e8e87 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 b1a403af9b..5dd03a97b2 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 4680b0e73d..89882ba6cc 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 bc07007daf..79665a719c 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 3bf712437b..bd40ea6c41 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 0c351fb7a3..67fa36e17b 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 1b401d0581..87fbccca3c 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 a5591172bc..6aebf773ff 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 f79d7b894c..948bd19361 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 25ec6759f7..37357a658e 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 df43de4c7b..ff5f665887 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 16f83b494a..bf91d1283d 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 1c29293f37..c4b4025eb3 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 55882372f8..e1a436b3c6 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 6c7ef1999f..53ccb2f693 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 4b076fc714..c95417f7d4 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 3ee1f7b086..9765f89298 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 18eb37be52..ecb05d8f47 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 2d1ec409e6..2de1105da3 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 4770884448..0235783a66 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 a1e968c973..291f89df8c 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 d4ed196dfa..a964c88239 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 8e6874a291..b29e8934d4 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 07ad6d91e5..8888ee4f0b 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 2bf2876846..5457fda867 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 b926d3d865..51a9b77290 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 a218b84187..e67b94c515 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 b9ae7a5bee..fa69974625 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 1e632cf945..b5dd55b4ca 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 8abed02240..549fcab706 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 0d54fa342f..3df8f06f7f 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 3f46fed4fc..98f2efba85 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 65c22aa62d..02f7e5f1ba 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 f478169a45..4d6e33fa0a 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 96df31b76f..48ab8b8bad 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 e39023ae67..cdba359379 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 5fb946c4a2..d230ccf5b9 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 0f433d495c..511ac0e679 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 8cc3ecefa7..890e7784d5 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 b4f2881afb..2da4a7e6b7 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 c826f15766..d14294211c 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 c7af51e913..a7e994cf0a 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 3d97597797..fb9b8cf5ff 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 06358d391c..f41ec845ca 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 01bc654567..a60063c574 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 38e9a8ef66..0dc4e77508 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 23ec825d0d..ed7373f2de 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 d99df993bd..4daee3363d 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 92491ba35b..59fbaaa1d2 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 dfa828838b..deaa4f52ca 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 ab23c27eda..b943e6715d 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 ce36ffd17b..8e2174ec79 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 6d632f844c..535757c51a 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 0f5fb74a66..778778a6a3 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 76c295c07d..ab73d58745 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 81aed226d1..5e60251326 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 d12c908df6..8b5bf3aaf5 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 b5dd9a3e45..eecb382e49 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 90d6d551b6..8b8ce4559e 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 3e8ff72245..f189a14190 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 0cf38a814c..1e415fb543 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 d049c9732e..1ea5d1b4d8 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 c49bbe2598..700870b5b7 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 156961fff5..a462c6da40 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 2da9fe8c13..decb975dbc 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 c53b125ba0..1578b95ee5 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 9e21cbab54..1ffce978c4 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 7afa48f690..db4900b662 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 7f81f25250..ea2d3c1d88 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 ceed97d165..2d930f4bb7 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 3699730997..b1d117d901 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 2a929d6f87..17633cdd45 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 5afb122d71..af6b83d9b9 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 37f0b4a2c4..52db640362 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 65d2dbd380..42267f41e9 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 0c80e348e4..310a896d4c 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 a5f9703f7a..2ad7abb35f 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 6ca9a5d833..0f36f8d321 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 2edd5f144e..38d79dd57f 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 f2e2ff2cfd..7bc265e6e0 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 2563d7730d..f0af9944a8 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 0e708973d2..18577cea91 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 5f31d89754..ee101b6689 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 828ffb179e..9688c99f7c 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 3498a91384..527cb36f45 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 889a9a1f82..fab01be995 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 b1171269d4..03e05792e3 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 a01e174e27..cf7541431c 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 f87e94b4b9..0000000000 --- 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 92e783d524..5c4a47d246 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 52be7547b5..dc7973d6e7 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 f2653b883e..6355f71634 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 b5e639bcfd..4245ac22e1 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 d4a4b21a37..3ba3083820 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 f6b2ff536b..5867e6416f 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 ea1ad59da3..e0214942e5 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 7c257a8e75..5e688b25de 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 98c58cfcc0..f217d0015f 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 0f0fc75e12..aaa0e58547 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 4c6021e580..3726c1213d 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 d8407468e9..da0bd13a5b 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 c5edf04d2f..2420889570 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 a87ac7bcec..0e9906d2e7 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 e4464dc880..c7693f6ded 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 7c165dcf6a..d4f2fd08a2 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 5820842739..e05e0a386e 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 0ad0c92cdf..ee1ec32d9b 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 a8728f6219..b0e246f2c1 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 716d1c8a8d..b8902a844d 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 b69742a28b..1e558ec9cf 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 47825f483b..0b45680575 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 12e39b7390..ed97d49ad2 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 8233d3381d..f8ee944768 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 b528899954..060c847276 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 795cbcc081..a9afb46c6c 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. //