diff --git a/src/Application.cpp b/src/Application.cpp index 92c009069b..37ca4f3952 100644 --- a/src/Application.cpp +++ b/src/Application.cpp @@ -12,8 +12,10 @@ #include "BitcoinUtil.h" #include "key.h" #include "utils.h" +#include "TaggedCache.h" -Application* theApp=NULL; + +Application* theApp = NULL; DatabaseCon::DatabaseCon(const std::string& name, const char *initStrings[], int initCount) { @@ -32,7 +34,7 @@ DatabaseCon::~DatabaseCon() Application::Application() : mUNL(mIOService), - mNetOps(mIOService, &mMasterLedger), + mNetOps(mIOService, &mMasterLedger), mNodeCache(16384, 600), mTxnDB(NULL), mLedgerDB(NULL), mWalletDB(NULL), mHashNodeDB(NULL), mNetNodeDB(NULL), mConnectionPool(mIOService), mPeerDoor(NULL), mRPCDoor(NULL) { diff --git a/src/Application.h b/src/Application.h index bf763f3998..55d405c66d 100644 --- a/src/Application.h +++ b/src/Application.h @@ -1,6 +1,8 @@ #ifndef __APPLICATION__ #define __APPLICATION__ +#include + #include "LedgerMaster.h" #include "UniqueNodeList.h" #include "ConnectionPool.h" @@ -10,12 +12,13 @@ #include "Wallet.h" #include "Peer.h" #include "NetworkOPs.h" +#include "TaggedCache.h" #include "../database/database.h" -#include class RPCDoor; class PeerDoor; +typedef TaggedCache< uint256, std::vector > NodeCache; class DatabaseCon { @@ -40,6 +43,7 @@ class Application LedgerAcquireMaster mMasterLedgerAcquire; TransactionMaster mMasterTransaction; NetworkOPs mNetOps; + NodeCache mNodeCache; DatabaseCon* mTxnDB, *mLedgerDB, *mWalletDB, *mHashNodeDB, *mNetNodeDB; @@ -57,18 +61,19 @@ public: Application(); ~Application(); - ConnectionPool& getConnectionPool() { return mConnectionPool; } + ConnectionPool& getConnectionPool() { return mConnectionPool; } - UniqueNodeList& getUNL() { return mUNL; } + UniqueNodeList& getUNL() { return mUNL; } - Wallet& getWallet() { return mWallet ; } - NetworkOPs& getOPs() { return mNetOps; } + Wallet& getWallet() { return mWallet ; } + NetworkOPs& getOPs() { return mNetOps; } - boost::asio::io_service& getIOService() { return mIOService; } + boost::asio::io_service& getIOService() { return mIOService; } - LedgerMaster& getMasterLedger() { return mMasterLedger; } - LedgerAcquireMaster& getMasterLedgerAcquire() { return mMasterLedgerAcquire; } - TransactionMaster& getMasterTransaction() { return mMasterTransaction; } + LedgerMaster& getMasterLedger() { return mMasterLedger; } + LedgerAcquireMaster& getMasterLedgerAcquire() { return mMasterLedgerAcquire; } + TransactionMaster& getMasterTransaction() { return mMasterTransaction; } + NodeCache& getNodeCache() { return mNodeCache; } DatabaseCon* getTxnDB() { return mTxnDB; } DatabaseCon* getLedgerDB() { return mLedgerDB; }