Use brace initializer instead of make_pair.
authorCryptoManiac <balthazar@yandex.ru>
Thu, 7 Apr 2016 17:48:18 +0000 (20:48 +0300)
committerCryptoManiac <balthazar@yandex.ru>
Thu, 7 Apr 2016 17:48:18 +0000 (20:48 +0300)
src/kernel.cpp
src/keystore.cpp
src/main.h
src/net.h
src/qt/walletmodel.cpp
src/rpcmining.cpp
src/rpcwallet.cpp
src/script.cpp
src/txdb-leveldb.h
src/wallet.cpp
src/walletdb.h

index aef297a..4d81ea5 100644 (file)
@@ -241,7 +241,7 @@ bool ComputeNextStakeModifier(const CBlockIndex* pindexCurrent, uint64_t& nStake
     const auto *pindex = pindexPrev;
     while (pindex && pindex->GetBlockTime() >= nSelectionIntervalStart)
     {
-        vSortedByTimestamp.push_back(make_pair(pindex->GetBlockTime(), pindex->GetBlockHash()));
+        vSortedByTimestamp.push_back({ pindex->GetBlockTime(), pindex->GetBlockHash() });
         pindex = pindex->pprev;
     }
     int nHeightFirstCandidate = pindex ? (pindex->nHeight + 1) : 0;
@@ -262,7 +262,7 @@ bool ComputeNextStakeModifier(const CBlockIndex* pindexCurrent, uint64_t& nStake
         // write the entropy bit of the selected block
         nStakeModifierNew |= (((uint64_t)pindex->GetStakeEntropyBit()) << nRound);
         // add the selected block from candidates to selected list
-        mapSelectedBlocks.insert(make_pair(pindex->GetBlockHash(), pindex));
+        mapSelectedBlocks.insert({ pindex->GetBlockHash(), pindex });
         if (fDebug && GetBoolArg("-printstakemodifier"))
             printf("ComputeNextStakeModifier: selected round %d stop=%s height=%d bit=%d\n", nRound, DateTimeStrFormat(nSelectionIntervalStop).c_str(), pindex->nHeight, pindex->GetStakeEntropyBit());
     }
index 948dfb7..e0e9ab3 100644 (file)
@@ -24,7 +24,7 @@ bool CBasicKeyStore::AddKey(const CKey& key)
     CSecret secret = key.GetSecret(fCompressed);
     {
         LOCK(cs_KeyStore);
-        mapKeys[key.GetPubKey().GetID()] = make_pair(secret, fCompressed);
+        mapKeys[key.GetPubKey().GetID()] = { secret, fCompressed };
     }
     return true;
 }
@@ -229,7 +229,7 @@ bool CCryptoKeyStore::AddCryptedKey(const CPubKey &vchPubKey, const std::vector<
         if (!SetCrypted())
             return false;
 
-        mapCryptedKeys[vchPubKey.GetID()] = make_pair(vchPubKey, vchCryptedSecret);
+        mapCryptedKeys[vchPubKey.GetID()] = { vchPubKey, vchCryptedSecret };
     }
     return true;
 }
index bd5a053..3d6bfa1 100644 (file)
@@ -18,6 +18,8 @@
 #include <list>
 #include <map>
 
+using namespace std;
+
 class CWallet;
 class CBlock;
 class CBlockIndex;
@@ -43,7 +45,7 @@ static const unsigned int MAX_INV_SZ = 50000;
 static const int64_t MIN_TX_FEE = CENT/10;
 static const int64_t MIN_RELAY_TX_FEE = CENT/50;
 
-static const int64_t MAX_MONEY = std::numeric_limits<int64_t>::max();
+static const int64_t MAX_MONEY = numeric_limits<int64_t>::max();
 static const int64_t MAX_MINT_PROOF_OF_WORK = 100 * COIN;
 static const int64_t MAX_MINT_PROOF_OF_STAKE = 1 * COIN;
 static const int64_t MIN_TXOUT_AMOUNT = CENT/100;
@@ -63,8 +65,8 @@ inline int64_t FutureDrift(int64_t nTime) { return nTime + 2 * nOneHour; } // up
 
 extern CScript COINBASE_FLAGS;
 extern CCriticalSection cs_main;
-extern std::map<uint256, CBlockIndex*> mapBlockIndex;
-extern std::set<std::pair<COutPoint, unsigned int> > setStakeSeen;
+extern map<uint256, CBlockIndex*> mapBlockIndex;
+extern set<pair<COutPoint, unsigned int> > setStakeSeen;
 extern CBlockIndex* pindexGenesisBlock;
 extern unsigned int nNodeLifespan;
 extern unsigned int nStakeMinAge;
@@ -78,12 +80,12 @@ extern unsigned int nTransactionsUpdated;
 extern uint64_t nLastBlockTx;
 extern uint64_t nLastBlockSize;
 extern uint32_t nLastCoinStakeSearchInterval;
-extern const std::string strMessageMagic;
+extern const string strMessageMagic;
 extern int64_t nTimeBestReceived;
 extern CCriticalSection cs_setpwalletRegistered;
-extern std::set<CWallet*> setpwalletRegistered;
+extern set<CWallet*> setpwalletRegistered;
 extern unsigned char pchMessageStart[4];
-extern std::map<uint256, CBlock*> mapOrphanBlocks;
+extern map<uint256, CBlock*> mapOrphanBlocks;
 
 // Settings
 extern int64_t nTransactionFee;
@@ -129,7 +131,7 @@ unsigned int ComputeMinWork(unsigned int nBase, int64_t nTime);
 unsigned int ComputeMinStake(unsigned int nBase, int64_t nTime, unsigned int nBlockTime);
 int GetNumBlocksOfPeers();
 bool IsInitialBlockDownload();
-std::string GetWarnings(std::string strFor);
+string GetWarnings(string strFor);
 bool GetTransaction(const uint256 &hash, CTransaction &tx, uint256 &hashBlock);
 uint256 WantedByOrphan(const CBlock* pblockOrphan);
 const CBlockIndex* GetLastBlockIndex(const CBlockIndex* pindex, bool fProofOfStake);
@@ -143,7 +145,7 @@ bool VerifySignature(const CTransaction& txFrom, const CTransaction& txTo, unsig
 
 
 
-bool GetWalletFile(CWallet* pwallet, std::string &strWalletFileOut);
+bool GetWalletFile(CWallet* pwallet, string &strWalletFileOut);
 
 /** Position on disk for a particular transaction. */
 class CDiskTxPos
@@ -166,8 +168,8 @@ public:
     }
 
     IMPLEMENT_SERIALIZE( READWRITE(FLATDATA(*this)); )
-    void SetNull() { nFile = std::numeric_limits<uint32_t>::max(); nBlockPos = 0; nTxPos = 0; }
-    bool IsNull() const { return (nFile == std::numeric_limits<uint32_t>::max()); }
+    void SetNull() { nFile = numeric_limits<uint32_t>::max(); nBlockPos = 0; nTxPos = 0; }
+    bool IsNull() const { return (nFile == numeric_limits<uint32_t>::max()); }
 
     friend bool operator==(const CDiskTxPos& a, const CDiskTxPos& b)
     {
@@ -182,7 +184,7 @@ public:
     }
 
 
-    std::string ToString() const
+    string ToString() const
     {
         if (IsNull())
             return "null";
@@ -207,8 +209,8 @@ public:
 
     CInPoint() { SetNull(); }
     CInPoint(CTransaction* ptxIn, unsigned int nIn) { ptx = ptxIn; n = nIn; }
-    void SetNull() { ptx = NULL; n = std::numeric_limits<uint32_t>::max(); }
-    bool IsNull() const { return (ptx == NULL && n == std::numeric_limits<uint32_t>::max()); }
+    void SetNull() { ptx = NULL; n = numeric_limits<uint32_t>::max(); }
+    bool IsNull() const { return (ptx == NULL && n == numeric_limits<uint32_t>::max()); }
 };
 
 
@@ -223,8 +225,8 @@ public:
     COutPoint() { SetNull(); }
     COutPoint(uint256 hashIn, unsigned int nIn) { hash = hashIn; n = nIn; }
     IMPLEMENT_SERIALIZE( READWRITE(FLATDATA(*this)); )
-    void SetNull() { hash = 0; n = std::numeric_limits<uint32_t>::max(); }
-    bool IsNull() const { return (hash == 0 && n == std::numeric_limits<uint32_t>::max()); }
+    void SetNull() { hash = 0; n = numeric_limits<uint32_t>::max(); }
+    bool IsNull() const { return (hash == 0 && n == numeric_limits<uint32_t>::max()); }
 
     friend bool operator<(const COutPoint& a, const COutPoint& b)
     {
@@ -241,7 +243,7 @@ public:
         return !(a == b);
     }
 
-    std::string ToString() const
+    string ToString() const
     {
         return strprintf("COutPoint(%s, %u)", hash.ToString().substr(0,10).c_str(), n);
     }
@@ -268,17 +270,17 @@ public:
 
     CTxIn()
     {
-        nSequence = std::numeric_limits<unsigned int>::max();
+        nSequence = numeric_limits<unsigned int>::max();
     }
 
-    explicit CTxIn(COutPoint prevoutIn, CScript scriptSigIn=CScript(), unsigned int nSequenceIn=std::numeric_limits<unsigned int>::max())
+    explicit CTxIn(COutPoint prevoutIn, CScript scriptSigIn=CScript(), unsigned int nSequenceIn=numeric_limits<unsigned int>::max())
     {
         prevout = prevoutIn;
         scriptSig = scriptSigIn;
         nSequence = nSequenceIn;
     }
 
-    CTxIn(uint256 hashPrevTx, unsigned int nOut, CScript scriptSigIn=CScript(), unsigned int nSequenceIn=std::numeric_limits<unsigned int>::max())
+    CTxIn(uint256 hashPrevTx, unsigned int nOut, CScript scriptSigIn=CScript(), unsigned int nSequenceIn=numeric_limits<unsigned int>::max())
     {
         prevout = COutPoint(hashPrevTx, nOut);
         scriptSig = scriptSigIn;
@@ -294,7 +296,7 @@ public:
 
     bool IsFinal() const
     {
-        return (nSequence == std::numeric_limits<unsigned int>::max());
+        return (nSequence == numeric_limits<unsigned int>::max());
     }
 
     friend bool operator==(const CTxIn& a, const CTxIn& b)
@@ -309,21 +311,21 @@ public:
         return !(a == b);
     }
 
-    std::string ToStringShort() const
+    string ToStringShort() const
     {
         return strprintf(" %s %d", prevout.hash.ToString().c_str(), prevout.n);
     }
 
-    std::string ToString() const
+    string ToString() const
     {
-        std::string str;
+        string str;
         str += "CTxIn(";
         str += prevout.ToString();
         if (prevout.IsNull())
             str += strprintf(", coinbase %s", HexStr(scriptSig).c_str());
         else
             str += strprintf(", scriptSig=%s", scriptSig.ToString().substr(0,24).c_str());
-        if (nSequence != std::numeric_limits<unsigned int>::max())
+        if (nSequence != numeric_limits<unsigned int>::max())
             str += strprintf(", nSequence=%u", nSequence);
         str += ")";
         return str;
@@ -402,12 +404,12 @@ public:
         return !(a == b);
     }
 
-    std::string ToStringShort() const
+    string ToStringShort() const
     {
         return strprintf(" out %s %s", FormatMoney(nValue).c_str(), scriptPubKey.ToString(true).c_str());
     }
 
-    std::string ToString() const
+    string ToString() const
     {
         if (IsEmpty()) return "CTxOut(empty)";
         if (scriptPubKey.size() < 6)
@@ -431,7 +433,7 @@ enum GetMinFee_mode
     GMF_SEND
 };
 
-typedef std::map<uint256, std::pair<CTxIndex, CTransaction> > MapPrevTx;
+typedef map<uint256, pair<CTxIndex, CTransaction> > MapPrevTx;
 
 /** The basic transaction that is broadcasted on the network and contained in
  * blocks.  A transaction can contain multiple inputs and outputs.
@@ -442,8 +444,8 @@ public:
     static const int CURRENT_VERSION=1;
     int nVersion;
     uint32_t nTime;
-    std::vector<CTxIn> vin;
-    std::vector<CTxOut> vout;
+    vector<CTxIn> vin;
+    vector<CTxOut> vout;
     uint32_t nLockTime;
 
     // Denial-of-service detection:
@@ -511,7 +513,7 @@ public:
                 return false;
 
         bool fNewer = false;
-        unsigned int nLowest = std::numeric_limits<unsigned int>::max();
+        unsigned int nLowest = numeric_limits<unsigned int>::max();
         for (unsigned int i = 0; i < vin.size(); i++)
         {
             if (vin[i].nSequence != old.vin[i].nSequence)
@@ -545,10 +547,10 @@ public:
     /** Check for standard transaction types
         @return True if all outputs (scriptPubKeys) use only standard transaction forms
     */
-    bool IsStandard(std::string& strReason) const;
+    bool IsStandard(string& strReason) const;
     bool IsStandard() const
     {
-        std::string strReason;
+        string strReason;
         return IsStandard(strReason);
     }
 
@@ -583,7 +585,7 @@ public:
         {
             nValueOut += txout.nValue;
             if (!MoneyRange(txout.nValue) || !MoneyRange(nValueOut))
-                throw std::runtime_error("CTransaction::GetValueOut() : value out of range");
+                throw runtime_error("CTransaction::GetValueOut() : value out of range");
         }
         return nValueOut;
     }
@@ -620,7 +622,7 @@ public:
         try {
             filein >> *this;
         }
-        catch (const std::exception&) {
+        catch (const exception&) {
             return error("%s() : deserialize or I/O error", BOOST_CURRENT_FUNCTION);
         }
 
@@ -648,16 +650,16 @@ public:
         return !(a == b);
     }
 
-    std::string ToStringShort() const
+    string ToStringShort() const
     {
-        std::string str;
+        string str;
         str += strprintf("%s %s", GetHash().ToString().c_str(), IsCoinBase()? "base" : (IsCoinStake()? "stake" : "user"));
         return str;
     }
 
-    std::string ToString() const
+    string ToString() const
     {
-        std::string str;
+        string str;
         str += IsCoinBase()? "Coinbase" : (IsCoinStake()? "Coinstake" : "CTransaction");
         str += strprintf("(hash=%s, nTime=%d, ver=%d, vin.size=%" PRIszu ", vout.size=%" PRIszu ", nLockTime=%d)\n",
             GetHash().ToString().substr(0,10).c_str(),
@@ -694,7 +696,7 @@ public:
      @param[out] fInvalid      returns true if transaction is invalid
      @return   Returns true if all inputs are in txdb or mapTestPool
      */
-    bool FetchInputs(CTxDB& txdb, const std::map<uint256, CTxIndex>& mapTestPool,
+    bool FetchInputs(CTxDB& txdb, const map<uint256, CTxIndex>& mapTestPool,
                      bool fBlock, bool fMiner, MapPrevTx& inputsRet, bool& fInvalid);
 
     /** Sanity check previous transactions, then, if all checks succeed,
@@ -711,9 +713,9 @@ public:
         @param[in] pvChecks    NULL If pvChecks is not NULL, script checks are pushed onto it instead of being performed inline.
         @return Returns true if all checks succeed
      */
-    bool ConnectInputs(CTxDB& txdb, MapPrevTx inputs, std::map<uint256, CTxIndex>& mapTestPool, const CDiskTxPos& posThisTx, const CBlockIndex* pindexBlock, 
+    bool ConnectInputs(CTxDB& txdb, MapPrevTx inputs, map<uint256, CTxIndex>& mapTestPool, const CDiskTxPos& posThisTx, const CBlockIndex* pindexBlock, 
                      bool fBlock, bool fMiner, bool fScriptChecks=true, 
-                     unsigned int flags=STRICT_FLAGS, std::vector<CScriptCheck> *pvChecks = NULL);
+                     unsigned int flags=STRICT_FLAGS, vector<CScriptCheck> *pvChecks = NULL);
     bool ClientConnectInputs();
     bool CheckTransaction() const;
     bool AcceptToMemoryPool(CTxDB& txdb, bool fCheckInputs=true, bool* pfMissingInputs=NULL);
@@ -759,7 +761,7 @@ class CMerkleTx : public CTransaction
 {
 public:
     uint256 hashBlock;
-    std::vector<uint256> vMerkleBranch;
+    vector<uint256> vMerkleBranch;
     int32_t nIndex;
 
     // memory only
@@ -814,7 +816,7 @@ class CTxIndex
 {
 public:
     CDiskTxPos pos;
-    std::vector<CDiskTxPos> vSpent;
+    vector<CDiskTxPos> vSpent;
 
     CTxIndex()
     {
@@ -884,13 +886,13 @@ public:
     uint32_t nNonce;
 
     // network and disk
-    std::vector<CTransaction> vtx;
+    vector<CTransaction> vtx;
 
     // ppcoin: block signature - signed by one of the coin base txout[N]'s owner
-    std::vector<unsigned char> vchBlockSig;
+    vector<unsigned char> vchBlockSig;
 
     // memory only
-    mutable std::vector<uint256> vMerkleTree;
+    mutable vector<uint256> vMerkleTree;
 
     // Denial-of-service detection:
     mutable int nDoS;
@@ -989,9 +991,12 @@ public:
         return !IsProofOfStake();
     }
 
-    std::pair<COutPoint, unsigned int> GetProofOfStake() const
+    pair<COutPoint, unsigned int> GetProofOfStake() const
     {
-        return IsProofOfStake()? std::make_pair(vtx[1].vin[0].prevout, vtx[1].nTime) : std::make_pair(COutPoint(), (unsigned int)0);
+        if (IsProofOfStake())
+            return { vtx[1].vin[0].prevout, vtx[1].nTime };
+
+        return { COutPoint(), (unsigned int)0 };
     }
 
     // ppcoin: get max transaction timestamp
@@ -999,7 +1004,7 @@ public:
     {
         int64_t maxTransactionTime = 0;
         for(const auto& tx :  vtx)
-            maxTransactionTime = std::max(maxTransactionTime, (int64_t)tx.nTime);
+            maxTransactionTime = max(maxTransactionTime, (int64_t)tx.nTime);
         return maxTransactionTime;
     }
 
@@ -1013,7 +1018,7 @@ public:
         {
             for (int i = 0; i < nSize; i += 2)
             {
-                int i2 = std::min(i+1, nSize-1);
+                int i2 = min(i+1, nSize-1);
                 vMerkleTree.push_back(Hash(BEGIN(vMerkleTree[j+i]),  END(vMerkleTree[j+i]),
                                            BEGIN(vMerkleTree[j+i2]), END(vMerkleTree[j+i2])));
             }
@@ -1022,15 +1027,15 @@ public:
         return (vMerkleTree.empty() ? 0 : vMerkleTree.back());
     }
 
-    std::vector<uint256> GetMerkleBranch(int nIndex) const
+    vector<uint256> GetMerkleBranch(int nIndex) const
     {
         if (vMerkleTree.empty())
             BuildMerkleTree();
-        std::vector<uint256> vMerkleBranch;
+        vector<uint256> vMerkleBranch;
         int j = 0;
         for (int nSize = (int)vtx.size(); nSize > 1; nSize = (nSize + 1) / 2)
         {
-            int i = std::min(nIndex^1, nSize-1);
+            int i = min(nIndex^1, nSize-1);
             vMerkleBranch.push_back(vMerkleTree[j+i]);
             nIndex >>= 1;
             j += nSize;
@@ -1038,7 +1043,7 @@ public:
         return vMerkleBranch;
     }
 
-    static uint256 CheckMerkleBranch(uint256 hash, const std::vector<uint256>& vMerkleBranch, int nIndex)
+    static uint256 CheckMerkleBranch(uint256 hash, const vector<uint256>& vMerkleBranch, int nIndex)
     {
         if (nIndex == -1)
             return 0;
@@ -1095,7 +1100,7 @@ public:
         try {
             filein >> *this;
         }
-        catch (const std::exception&) {
+        catch (const exception&) {
             return error("%s() : deserialize or I/O error", BOOST_CURRENT_FUNCTION);
         }
 
@@ -1299,7 +1304,7 @@ public:
         for (int i = 0; i < nMedianTimeSpan && pindex; i++, pindex = pindex->pprev)
             *(--pbegin) = pindex->GetBlockTime();
 
-        std::sort(pbegin, pend);
+        sort(pbegin, pend);
         return pbegin[(pend - pbegin)/2];
     }
 
@@ -1363,7 +1368,7 @@ public:
             nFlags |= BLOCK_STAKE_MODIFIER;
     }
 
-    std::string ToString() const
+    string ToString() const
     {
         return strprintf("CBlockIndex(nprev=%p, pnext=%p, nFile=%u, nBlockPos=%-6d nHeight=%d, nMint=%s, nMoneySupply=%s, nFlags=(%s)(%d)(%s), nStakeModifier=%016" PRIx64 ", nStakeModifierChecksum=%08x, hashProofOfStake=%s, prevoutStake=(%s), nStakeTime=%d merkle=%s, hashBlock=%s)",
             (const void*)pprev, (const void*)pnext, nFile, nBlockPos, nHeight,
@@ -1461,9 +1466,9 @@ public:
         return blockHash;
     }
 
-    std::string ToString() const
+    string ToString() const
     {
-        std::string str = "CDiskBlockIndex(";
+        string str = "CDiskBlockIndex(";
         str += CBlockIndex::ToString();
         str += strprintf("\n                hashBlock=%s, hashPrev=%s, hashNext=%s)",
             GetBlockHash().ToString().c_str(),
@@ -1492,7 +1497,7 @@ public:
 class CBlockLocator
 {
 protected:
-    std::vector<uint256> vHave;
+    vector<uint256> vHave;
 public:
 
     CBlockLocator()
@@ -1511,7 +1516,7 @@ public:
             Set((*mi).second);
     }
 
-    CBlockLocator(const std::vector<uint256>& vHaveIn)
+    CBlockLocator(const vector<uint256>& vHaveIn)
     {
         vHave = vHaveIn;
     }
@@ -1623,15 +1628,15 @@ class CTxMemPool
 {
 public:
     mutable CCriticalSection cs;
-    std::map<uint256, CTransaction> mapTx;
-    std::map<COutPoint, CInPoint> mapNextTx;
+    map<uint256, CTransaction> mapTx;
+    map<COutPoint, CInPoint> mapNextTx;
 
     bool accept(CTxDB& txdb, CTransaction &tx,
                 bool fCheckInputs, bool* pfMissingInputs);
     bool addUnchecked(const uint256& hash, CTransaction &tx);
     bool remove(CTransaction &tx);
     void clear();
-    void queryHashes(std::vector<uint256>& vtxid);
+    void queryHashes(vector<uint256>& vtxid);
 
     size_t size()
     {
index d68e0fc..cc6b20d 100644 (file)
--- a/src/net.h
+++ b/src/net.h
@@ -21,6 +21,8 @@
 #include "addrman.h"
 #include "hash.h"
 
+using namespace std;
+
 class CRequestTracker;
 class CNode;
 class CBlockIndex;
@@ -33,8 +35,8 @@ const uint16_t nPortZero = 0;
 inline uint64_t ReceiveBufferSize() { return 1000*GetArg("-maxreceivebuffer", 5*1000); }
 inline uint64_t SendBufferSize() { return 1000*GetArg("-maxsendbuffer", 1*1000); }
 
-void AddOneShot(std::string strDest);
-bool RecvLine(SOCKET hSocket, std::string& strLine);
+void AddOneShot(string strDest);
+bool RecvLine(SOCKET hSocket, string& strLine);
 bool GetMyExternalIP(CNetAddr& ipRet);
 void AddressCurrentlyConnected(const CService& addr);
 CNode* FindNode(const CNetAddr& ip);
@@ -43,7 +45,7 @@ CNode* ConnectNode(CAddress addrConnect, const char *strDest = NULL, int64_t nTi
 bool OpenNetworkConnection(const CAddress& addrConnect, CSemaphoreGrant *grantOutbound = NULL, const char *strDest = NULL, bool fOneShot = false);
 void MapPort();
 unsigned short GetListenPort();
-bool BindListenPort(const CService &bindAddr, std::string& strError=REF(std::string()));
+bool BindListenPort(const CService &bindAddr, string& strError=REF(string()));
 void StartNode(void* parg);
 bool StopNode();
 
@@ -130,14 +132,14 @@ extern CAddress addrSeenByPeer;
 extern boost::array<int, THREAD_MAX> vnThreadsRunning;
 extern CAddrMan addrman;
 
-extern std::vector<CNode*> vNodes;
+extern vector<CNode*> vNodes;
 extern CCriticalSection cs_vNodes;
-extern std::vector<std::string> vAddedNodes;
+extern vector<string> vAddedNodes;
 extern CCriticalSection cs_vAddedNodes;
-extern std::map<CInv, CDataStream> mapRelay;
-extern std::deque<std::pair<int64_t, CInv> > vRelayExpiration;
+extern map<CInv, CDataStream> mapRelay;
+extern deque<pair<int64_t, CInv> > vRelayExpiration;
 extern CCriticalSection cs_mapRelay;
-extern std::map<CInv, int64_t> mapAlreadyAskedFor;
+extern map<CInv, int64_t> mapAlreadyAskedFor;
 
 
 
@@ -149,9 +151,9 @@ public:
     int64_t nLastSend;
     int64_t nLastRecv;
     int64_t nTimeConnected;
-    std::string addrName;
+    string addrName;
     int32_t nVersion;
-    std::string strSubVer;
+    string strSubVer;
     bool fInbound;
     int64_t nReleaseTime;
     int32_t nStartingHeight;
@@ -185,10 +187,10 @@ public:
     int32_t nHeaderStart;
     uint32_t nMessageStart;
     CAddress addr;
-    std::string addrName;
+    string addrName;
     CService addrLocal;
     int32_t nVersion;
-    std::string strSubVer;
+    string strSubVer;
     bool fOneShot;
     bool fClient;
     bool fInbound;
@@ -201,13 +203,13 @@ protected:
 
     // Denial-of-service detection/prevention
     // Key is IP address, value is banned-until-time
-    static std::map<CNetAddr, int64_t> setBanned;
+    static map<CNetAddr, int64_t> setBanned;
     static CCriticalSection cs_setBanned;
     int nMisbehavior;
 
 public:
     int64_t nReleaseTime;
-    std::map<uint256, CRequestTracker> mapRequests;
+    map<uint256, CRequestTracker> mapRequests;
     CCriticalSection cs_mapRequests;
     uint256 hashContinue;
     CBlockIndex* pindexLastGetBlocksBegin;
@@ -216,10 +218,10 @@ public:
     bool fStartSync;
 
     // flood relay
-    std::vector<CAddress> vAddrToSend;
-    std::set<CAddress> setAddrKnown;
+    vector<CAddress> vAddrToSend;
+    set<CAddress> setAddrKnown;
     bool fGetAddr;
-    std::set<uint256> setKnown;
+    set<uint256> setKnown;
     uint256 hashCheckpointKnown; // ppcoin: known sent sync-checkpoint
     int64_t nNextAddrSend;
     int64_t nNextLocalAddrSend;
@@ -227,11 +229,11 @@ public:
 
     // inventory based relay
     mruset<CInv> setInventoryKnown;
-    std::vector<CInv> vInventoryToSend;
+    vector<CInv> vInventoryToSend;
     CCriticalSection cs_inventory;
-    std::multimap<int64_t, CInv> mapAskFor;
+    multimap<int64_t, CInv> mapAskFor;
 
-    CNode(SOCKET hSocketIn, CAddress addrIn, std::string addrNameIn = "", bool fInboundIn=false) : vSend(SER_NETWORK, MIN_PROTO_VERSION), vRecv(SER_NETWORK, MIN_PROTO_VERSION)
+    CNode(SOCKET hSocketIn, CAddress addrIn, string addrNameIn = "", bool fInboundIn=false) : vSend(SER_NETWORK, MIN_PROTO_VERSION), vRecv(SER_NETWORK, MIN_PROTO_VERSION)
     {
         nServices = 0;
         hSocket = hSocketIn;
@@ -242,7 +244,7 @@ public:
         nLastSendEmpty = GetTime();
         nTimeConnected = GetTime();
         nHeaderStart = -1;
-        nMessageStart = std::numeric_limits<uint32_t>::max();
+        nMessageStart = numeric_limits<uint32_t>::max();
         addr = addrIn;
         addrName = addrNameIn.empty() ? addr.ToStringIPPort() : addrNameIn;
         nVersion = 0;
@@ -295,13 +297,13 @@ public:
 
     int GetRefCount()
     {
-        return std::max(nRefCount, 0) + (GetTime() < nReleaseTime ? 1 : 0);
+        return max(nRefCount, 0) + (GetTime() < nReleaseTime ? 1 : 0);
     }
 
     CNode* AddRef(int64_t nTimeout=0)
     {
         if (nTimeout != 0)
-            nReleaseTime = std::max(nReleaseTime, GetTime() + nTimeout);
+            nReleaseTime = max(nReleaseTime, GetTime() + nTimeout);
         else
             nRefCount++;
         return this;
@@ -358,12 +360,12 @@ public:
         int64_t nNow = (GetTime() - 1) * 1000000;
         static int64_t nLastTime;
         ++nLastTime;
-        nNow = std::max(nNow, nLastTime);
+        nNow = max(nNow, nLastTime);
         nLastTime = nNow;
 
         // Each retry is 2 minutes after the last
-        nRequestTime = std::max(nRequestTime + 2 * 60 * 1000000, nNow);
-        mapAskFor.insert(std::make_pair(nRequestTime, inv));
+        nRequestTime = max(nRequestTime + 2 * 60 * 1000000, nNow);
+        mapAskFor.insert({ nRequestTime, inv });
     }
 
 
@@ -386,7 +388,7 @@ public:
             return;
         vSend.resize(nHeaderStart);
         nHeaderStart = -1;
-        nMessageStart = std::numeric_limits<uint32_t>::max();
+        nMessageStart = numeric_limits<uint32_t>::max();
         LEAVE_CRITICAL_SECTION(cs_vSend);
 
         if (fDebug)
@@ -421,7 +423,7 @@ public:
         }
 
         nHeaderStart = -1;
-        nMessageStart = std::numeric_limits<uint32_t>::max();
+        nMessageStart = numeric_limits<uint32_t>::max();
         LEAVE_CRITICAL_SECTION(cs_vSend);
     }
 
index 9362014..9304cd7 100644 (file)
@@ -208,7 +208,7 @@ WalletModel::SendCoinsReturn WalletModel::sendCoins(const QList<SendCoinsRecipie
         {
             CScript scriptPubKey;
             scriptPubKey.SetAddress(CBitcoinAddress(rcp.address.toStdString()));
-            vecSend.push_back(make_pair(scriptPubKey, rcp.amount));
+            vecSend.push_back({ scriptPubKey, rcp.amount });
         }
 
         CWalletTx wtx;
index f7758aa..714eb76 100644 (file)
@@ -286,7 +286,7 @@ Value getworkex(const Array& params, bool fHelp)
         IncrementExtraNonce(pblock, pindexPrev, nExtraNonce);
 
         // Save
-        mapNewBlock[pblock->hashMerkleRoot] = make_pair(pblock, pblock->vtx[0].vin[0].scriptSig);
+        mapNewBlock[pblock->hashMerkleRoot] = { pblock, pblock->vtx[0].vin[0].scriptSig };
 
         // Prebuild hash buffers
         char pmidstate[32];
@@ -425,7 +425,7 @@ Value getwork(const Array& params, bool fHelp)
         IncrementExtraNonce(pblock, pindexPrev, nExtraNonce);
 
         // Save
-        mapNewBlock[pblock->hashMerkleRoot] = make_pair(pblock, pblock->vtx[0].vin[0].scriptSig);
+        mapNewBlock[pblock->hashMerkleRoot] = { pblock, pblock->vtx[0].vin[0].scriptSig };
 
         // Pre-build hash buffers
         char pmidstate[32];
index d966245..e892bfb 100644 (file)
@@ -790,7 +790,7 @@ Value sendmany(const Array& params, bool fHelp)
 
         totalAmount += nAmount;
 
-        vecSend.push_back(make_pair(scriptPubKey, nAmount));
+        vecSend.push_back({ scriptPubKey, nAmount });
     }
 
     EnsureWalletIsUnlocked();
index e514535..7a8ffdb 100644 (file)
@@ -1318,19 +1318,19 @@ bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, vector<vector<unsi
     if (mTemplates.empty())
     {
         // Standard tx, sender provides pubkey, receiver adds signature
-        mTemplates.insert(make_pair(TX_PUBKEY, CScript() << OP_PUBKEY << OP_CHECKSIG));
+        mTemplates.insert({ TX_PUBKEY, CScript() << OP_PUBKEY << OP_CHECKSIG });
 
         // Malleable pubkey tx hack, sender provides generated pubkey combined with R parameter. The R parameter is dropped before checking a signature.
-        mTemplates.insert(make_pair(TX_PUBKEY_DROP, CScript() << OP_PUBKEY << OP_PUBKEY << OP_DROP << OP_CHECKSIG));
+        mTemplates.insert({ TX_PUBKEY_DROP, CScript() << OP_PUBKEY << OP_PUBKEY << OP_DROP << OP_CHECKSIG });
 
         // Bitcoin address tx, sender provides hash of pubkey, receiver provides signature and pubkey
-        mTemplates.insert(make_pair(TX_PUBKEYHASH, CScript() << OP_DUP << OP_HASH160 << OP_PUBKEYHASH << OP_EQUALVERIFY << OP_CHECKSIG));
+        mTemplates.insert({ TX_PUBKEYHASH, CScript() << OP_DUP << OP_HASH160 << OP_PUBKEYHASH << OP_EQUALVERIFY << OP_CHECKSIG });
 
         // Sender provides N pubkeys, receivers provides M signatures
-        mTemplates.insert(make_pair(TX_MULTISIG, CScript() << OP_SMALLINTEGER << OP_PUBKEYS << OP_SMALLINTEGER << OP_CHECKMULTISIG));
+        mTemplates.insert({ TX_MULTISIG, CScript() << OP_SMALLINTEGER << OP_PUBKEYS << OP_SMALLINTEGER << OP_CHECKMULTISIG });
 
         // Empty, provably prunable, data-carrying output
-        mTemplates.insert(make_pair(TX_NULL_DATA, CScript() << OP_RETURN << OP_SMALLDATA));
+        mTemplates.insert({ TX_NULL_DATA, CScript() << OP_RETURN << OP_SMALLDATA });
     }
 
     vSolutionsRet.clear();
index 07c7088..5447f51 100644 (file)
@@ -15,6 +15,8 @@
 #include <leveldb/db.h>
 #include <leveldb/write_batch.h>
 
+using namespace std;
+
 // Class that provides access to a LevelDB. Note that this class is frequently
 // instantiated on the stack and then destroyed again, so instantiation has to
 // be very cheap. Unfortunately that means, a CTxDB instance is actually just a
@@ -54,7 +56,7 @@ protected:
     // Returns true and sets (value,false) if activeBatch contains the given key
     // or leaves value alone and sets deleted = true if activeBatch contains a
     // delete for it.
-    bool ScanBatch(const CDataStream &key, std::string *value, bool *deleted) const;
+    bool ScanBatch(const CDataStream &key, string *value, bool *deleted) const;
 
     template<typename K, typename T>
     bool Read(const K& key, T& value)
@@ -62,7 +64,7 @@ protected:
         CDataStream ssKey(SER_DISK, CLIENT_VERSION);
         ssKey.reserve(1000);
         ssKey << key;
-        std::string strValue;
+        string strValue;
 
         bool readFromDb = true;
         if (activeBatch) {
@@ -91,7 +93,7 @@ protected:
                                 SER_DISK, CLIENT_VERSION);
             ssValue >> value;
         }
-        catch (const std::exception&) {
+        catch (const exception&) {
             return false;
         }
         return true;
@@ -147,7 +149,7 @@ protected:
         CDataStream ssKey(SER_DISK, CLIENT_VERSION);
         ssKey.reserve(1000);
         ssKey << key;
-        std::string unused;
+        string unused;
 
         if (activeBatch) {
             bool deleted;
@@ -175,12 +177,12 @@ public:
     bool ReadVersion(int& nVersion)
     {
         nVersion = 0;
-        return Read(std::string("version"), nVersion);
+        return Read(string("version"), nVersion);
     }
 
     bool WriteVersion(int nVersion)
     {
-        return Write(std::string("version"), nVersion);
+        return Write(string("version"), nVersion);
     }
 
     bool ReadTxIndex(uint256 hash, CTxIndex& txindex);
@@ -199,8 +201,8 @@ public:
     bool WriteBestInvalidTrust(CBigNum bnBestInvalidTrust);
     bool ReadSyncCheckpoint(uint256& hashCheckpoint);
     bool WriteSyncCheckpoint(uint256 hashCheckpoint);
-    bool ReadCheckpointPubKey(std::string& strPubKey);
-    bool WriteCheckpointPubKey(const std::string& strPubKey);
+    bool ReadCheckpointPubKey(string& strPubKey);
+    bool WriteCheckpointPubKey(const string& strPubKey);
     bool ReadModifierUpgradeTime(unsigned int& nUpgradeTime);
     bool WriteModifierUpgradeTime(const unsigned int& nUpgradeTime);
     bool LoadBlockIndex();
index f3573b0..d64f78a 100644 (file)
@@ -562,13 +562,13 @@ CWallet::TxItems CWallet::OrderedTxItems(list<CAccountingEntry>& acentries, stri
     for (auto it = mapWallet.begin(); it != mapWallet.end(); ++it)
     {
         CWalletTx* wtx = &((*it).second);
-        txOrdered.insert(make_pair(wtx->nOrderPos, TxPair(wtx, (CAccountingEntry*)0)));
+        txOrdered.insert({ wtx->nOrderPos, { wtx, (CAccountingEntry*)0 } });
     }
     acentries.clear();
     walletdb.ListAccountCreditDebit(strAccount, acentries);
     for(auto& entry : acentries)
     {
-        txOrdered.insert(make_pair(entry.nOrderPos, TxPair((CWalletTx*)0, &entry)));
+        txOrdered.insert({ entry.nOrderPos, { (CWalletTx*)0, &entry } });
     }
 
     return txOrdered;
@@ -636,7 +636,7 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn)
     {
         LOCK(cs_wallet);
         // Inserts only if not already there, returns tx inserted or tx found
-        auto ret = mapWallet.insert(make_pair(hash, wtxIn));
+        auto ret = mapWallet.insert({ hash, wtxIn });
         auto& wtx = (*ret.first).second;
         wtx.BindWallet(this);
         bool fInsertedNew = ret.second;
@@ -1280,11 +1280,11 @@ void CWalletTx::GetAmounts(int64_t& nGeneratedImmature, int64_t& nGeneratedMatur
 
         // If we are debited by the transaction, add the output as a "sent" entry
         if (nDebit > 0)
-            listSent.push_back(make_pair(address, txout.nValue));
+            listSent.push_back({ address, txout.nValue });
 
         // If we are receiving the output, add it as a "received" entry
         if (fIsMine & filter)
-            listReceived.push_back(make_pair(address, txout.nValue));
+            listReceived.push_back({ address, txout.nValue });
     }
 
 }
@@ -1527,7 +1527,7 @@ vector<uint256> CWallet::ResendWalletTransactionsBefore(int64_t nTime)
         // Don't rebroadcast if newer than nTime:
         if (wtx.nTimeReceived > nTime)
             continue;
-        mapSorted.insert(make_pair(wtx.nTimeReceived, &wtx));
+        mapSorted.insert({ wtx.nTimeReceived, &wtx });
     }
     for(auto& item : mapSorted)
     {
@@ -1848,7 +1848,7 @@ bool CWallet::SelectCoinsMinConf(int64_t nTargetValue, unsigned int nSpendTime,
             continue;
 
         auto n = pcoin->vout[i].nValue;
-        auto coin = make_pair(n,make_pair(pcoin, i));
+        auto coin = make_pair(n, make_pair(pcoin, i));
 
         if (n == nTargetValue)
         {
@@ -1938,7 +1938,7 @@ bool CWallet::SelectCoins(int64_t nTargetValue, unsigned int nSpendTime, set<pai
             if(!out.fSpendable)
                 continue;
             nValueRet += out.tx->vout[out.i].nValue;
-            setCoinsRet.insert(make_pair(out.tx, out.i));
+            setCoinsRet.insert({ out.tx, out.i });
         }
         return (nValueRet >= nTargetValue);
     }
@@ -1977,7 +1977,7 @@ bool CWallet::SelectCoinsSimple(int64_t nTargetValue, int64_t nMinValue, int64_t
             continue;
 
         auto n = pcoin->vout[i].nValue;
-        auto coin = make_pair(n,make_pair(pcoin, i));
+        auto coin = make_pair(n, make_pair(pcoin, i));
 
         if (n >= nTargetValue)
         {
@@ -2116,7 +2116,7 @@ bool CWallet::CreateTransaction(const vector<pair<CScript, int64_t> >& vecSend,
 bool CWallet::CreateTransaction(CScript scriptPubKey, int64_t nValue, CWalletTx& wtxNew, CReserveKey& reservekey, int64_t& nFeeRet, const CCoinControl* coinControl)
 {
     vector< pair<CScript, int64_t> > vecSend;
-    vecSend.push_back(make_pair(scriptPubKey, nValue));
+    vecSend.push_back({ scriptPubKey, nValue });
     return CreateTransaction(vecSend, wtxNew, reservekey, nFeeRet, coinControl);
 }
 
index 714b3cc..f058a85 100644 (file)
@@ -6,9 +6,10 @@
 #define BITCOIN_WALLETDB_H
 
 #include "db.h"
-//#include "base58.h"
 #include "keystore.h"
 
+using namespace std;
+
 class CKeyPool;
 class CAccount;
 class CAccountingEntry;
@@ -60,36 +61,36 @@ public:
 class CWalletDB : public CDB
 {
 public:
-    CWalletDB(std::string strFilename, const char* pszMode="r+") : CDB(strFilename.c_str(), pszMode)
+    CWalletDB(string strFilename, const char* pszMode="r+") : CDB(strFilename.c_str(), pszMode)
     {
     }
 private:
     CWalletDB(const CWalletDB&);
     void operator=(const CWalletDB&);
 public:
-    bool WriteName(const std::string& strAddress, const std::string& strName);
+    bool WriteName(const string& strAddress, const string& strName);
 
-    bool EraseName(const std::string& strAddress);
+    bool EraseName(const string& strAddress);
 
     bool WriteTx(uint256 hash, const CWalletTx& wtx)
     {
         nWalletDBUpdated++;
-        return Write(std::make_pair(std::string("tx"), hash), wtx);
+        return Write(make_pair(string("tx"), hash), wtx);
     }
 
     bool EraseTx(uint256 hash)
     {
         nWalletDBUpdated++;
-        return Erase(std::make_pair(std::string("tx"), hash));
+        return Erase(make_pair(string("tx"), hash));
     }
 
     bool WriteKey(const CPubKey& key, const CPrivKey& vchPrivKey, const CKeyMetadata &keyMeta)
     {
         nWalletDBUpdated++;
-        if(!Write(std::make_pair(std::string("keymeta"), key), keyMeta))
+        if(!Write(make_pair(string("keymeta"), key), keyMeta))
             return false;
 
-        if(!Write(std::make_pair(std::string("key"), key), vchPrivKey, false))
+        if(!Write(make_pair(string("key"), key), vchPrivKey, false))
             return false;
 
         return true;
@@ -98,44 +99,44 @@ public:
     bool WriteMalleableKey(const CMalleableKeyView& keyView, const CSecret& vchSecretH, const CKeyMetadata &keyMeta)
     {
         nWalletDBUpdated++;
-        if(!Write(std::make_pair(std::string("malmeta"), keyView.ToString()), keyMeta))
+        if(!Write(make_pair(string("malmeta"), keyView.ToString()), keyMeta))
             return false;
 
-        if(!Write(std::make_pair(std::string("malpair"), keyView.ToString()), vchSecretH, false))
+        if(!Write(make_pair(string("malpair"), keyView.ToString()), vchSecretH, false))
             return false;
 
         return true;
     }
 
-    bool WriteCryptedMalleableKey(const CMalleableKeyView& keyView, const std::vector<unsigned char>& vchCryptedSecretH, const CKeyMetadata &keyMeta)
+    bool WriteCryptedMalleableKey(const CMalleableKeyView& keyView, const vector<unsigned char>& vchCryptedSecretH, const CKeyMetadata &keyMeta)
     {
         nWalletDBUpdated++;
-        if(!Write(std::make_pair(std::string("malmeta"), keyView.ToString()), keyMeta))
+        if(!Write(make_pair(string("malmeta"), keyView.ToString()), keyMeta))
             return false;
 
-        if(!Write(std::make_pair(std::string("malcpair"), keyView.ToString()), vchCryptedSecretH, false))
+        if(!Write(make_pair(string("malcpair"), keyView.ToString()), vchCryptedSecretH, false))
             return false;
 
-        Erase(std::make_pair(std::string("malpair"), keyView.ToString()));
+        Erase(make_pair(string("malpair"), keyView.ToString()));
 
         return true;
     }
 
 
-    bool WriteCryptedKey(const CPubKey& key, const std::vector<unsigned char>& vchCryptedSecret, const CKeyMetadata &keyMeta)
+    bool WriteCryptedKey(const CPubKey& key, const vector<unsigned char>& vchCryptedSecret, const CKeyMetadata &keyMeta)
     {
         nWalletDBUpdated++;
         bool fEraseUnencryptedKey = true;
 
-        if(!Write(std::make_pair(std::string("keymeta"), key), keyMeta))
+        if(!Write(make_pair(string("keymeta"), key), keyMeta))
             return false;
 
-        if (!Write(std::make_pair(std::string("ckey"), key), vchCryptedSecret, false))
+        if (!Write(make_pair(string("ckey"), key), vchCryptedSecret, false))
             return false;
         if (fEraseUnencryptedKey)
         {
-            Erase(std::make_pair(std::string("key"), key));
-            Erase(std::make_pair(std::string("wkey"), key));
+            Erase(make_pair(string("key"), key));
+            Erase(make_pair(string("wkey"), key));
         }
         return true;
     }
@@ -143,104 +144,104 @@ public:
     bool WriteMasterKey(unsigned int nID, const CMasterKey& kMasterKey)
     {
         nWalletDBUpdated++;
-        return Write(std::make_pair(std::string("mkey"), nID), kMasterKey, true);
+        return Write(make_pair(string("mkey"), nID), kMasterKey, true);
     }
 
     bool EraseMasterKey(unsigned int nID)
     {
         nWalletDBUpdated++;
-        return Erase(std::make_pair(std::string("mkey"), nID));
+        return Erase(make_pair(string("mkey"), nID));
     }
 
     bool EraseCryptedKey(const CPubKey& key)
     {
-        return Erase(std::make_pair(std::string("ckey"), key));
+        return Erase(make_pair(string("ckey"), key));
     }
 
     bool EraseCryptedMalleableKey(const CMalleableKeyView& keyView)
     {
-        return Erase(std::make_pair(std::string("malcpair"), keyView.ToString()));
+        return Erase(make_pair(string("malcpair"), keyView.ToString()));
     }
 
     bool WriteCScript(const uint160& hash, const CScript& redeemScript)
     {
         nWalletDBUpdated++;
-        return Write(std::make_pair(std::string("cscript"), hash), redeemScript, false);
+        return Write(make_pair(string("cscript"), hash), redeemScript, false);
     }
 
     bool WriteWatchOnly(const CScript &dest)
     {
         nWalletDBUpdated++;
-        return Write(std::make_pair(std::string("watchs"), dest), '1');
+        return Write(make_pair(string("watchs"), dest), '1');
     }
 
     bool EraseWatchOnly(const CScript &dest)
     {
         nWalletDBUpdated++;
-        return Erase(std::make_pair(std::string("watchs"), dest));
+        return Erase(make_pair(string("watchs"), dest));
     }
 
     bool WriteBestBlock(const CBlockLocator& locator)
     {
         nWalletDBUpdated++;
-        return Write(std::string("bestblock"), locator);
+        return Write(string("bestblock"), locator);
     }
 
     bool ReadBestBlock(CBlockLocator& locator)
     {
-        return Read(std::string("bestblock"), locator);
+        return Read(string("bestblock"), locator);
     }
 
     bool WriteOrderPosNext(int64_t nOrderPosNext)
     {
         nWalletDBUpdated++;
-        return Write(std::string("orderposnext"), nOrderPosNext);
+        return Write(string("orderposnext"), nOrderPosNext);
     }
 
     bool WriteDefaultKey(const CPubKey& key)
     {
         nWalletDBUpdated++;
-        return Write(std::string("defaultkey"), key);
+        return Write(string("defaultkey"), key);
     }
 
     bool ReadPool(int64_t nPool, CKeyPool& keypool)
     {
-        return Read(std::make_pair(std::string("pool"), nPool), keypool);
+        return Read(make_pair(string("pool"), nPool), keypool);
     }
 
     bool WritePool(int64_t nPool, const CKeyPool& keypool)
     {
         nWalletDBUpdated++;
-        return Write(std::make_pair(std::string("pool"), nPool), keypool);
+        return Write(make_pair(string("pool"), nPool), keypool);
     }
 
     bool ErasePool(int64_t nPool)
     {
         nWalletDBUpdated++;
-        return Erase(std::make_pair(std::string("pool"), nPool));
+        return Erase(make_pair(string("pool"), nPool));
     }
 
     bool WriteMinVersion(int nVersion)
     {
-        return Write(std::string("minversion"), nVersion);
+        return Write(string("minversion"), nVersion);
     }
 
-    bool ReadAccount(const std::string& strAccount, CAccount& account);
-    bool WriteAccount(const std::string& strAccount, const CAccount& account);
+    bool ReadAccount(const string& strAccount, CAccount& account);
+    bool WriteAccount(const string& strAccount, const CAccount& account);
 private:
     bool WriteAccountingEntry(const uint64_t nAccEntryNum, const CAccountingEntry& acentry);
 public:
     bool WriteAccountingEntry(const CAccountingEntry& acentry);
-    int64_t GetAccountCreditDebit(const std::string& strAccount);
-    void ListAccountCreditDebit(const std::string& strAccount, std::list<CAccountingEntry>& acentries);
+    int64_t GetAccountCreditDebit(const string& strAccount);
+    void ListAccountCreditDebit(const string& strAccount, list<CAccountingEntry>& acentries);
 
     DBErrors ReorderTransactions(CWallet*);
     DBErrors LoadWallet(CWallet* pwallet);
-    DBErrors FindWalletTx(CWallet* pwallet, std::vector<uint256>& vTxHash);
+    DBErrors FindWalletTx(CWallet* pwallet, vector<uint256>& vTxHash);
     DBErrors ZapWalletTx(CWallet* pwallet);
 
-    static bool Recover(CDBEnv& dbenv, std::string filename, bool fOnlyKeys);
-    static bool Recover(CDBEnv& dbenv, std::string filename);
+    static bool Recover(CDBEnv& dbenv, string filename, bool fOnlyKeys);
+    static bool Recover(CDBEnv& dbenv, string filename);
 };
 
 #endif // BITCOIN_WALLETDB_H