diff --git a/src/script/standard.cpp b/src/script/standard.cpp --- a/src/script/standard.cpp +++ b/src/script/standard.cpp @@ -10,9 +10,7 @@ #include "util.h" #include "utilstrencodings.h" -using namespace std; - -typedef vector valtype; +typedef std::vector valtype; bool fAcceptDatacarrier = DEFAULT_ACCEPT_DATACARRIER; unsigned nMaxDatacarrierBytes = MAX_OP_RETURN_RELAY; @@ -43,22 +41,22 @@ * types. */ bool Solver(const CScript &scriptPubKey, txnouttype &typeRet, - vector> &vSolutionsRet) { + std::vector> &vSolutionsRet) { // Templates - static multimap mTemplates; + static std::multimap mTemplates; if (mTemplates.empty()) { // Standard tx, sender provides pubkey, receiver adds signature mTemplates.insert( - make_pair(TX_PUBKEY, CScript() << OP_PUBKEY << OP_CHECKSIG)); + std::make_pair(TX_PUBKEY, CScript() << OP_PUBKEY << OP_CHECKSIG)); // Bitcoin address tx, sender provides hash of pubkey, receiver provides // signature and pubkey - mTemplates.insert(make_pair( + mTemplates.insert(std::make_pair( 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( + mTemplates.insert(std::make_pair( TX_MULTISIG, CScript() << OP_SMALLINTEGER << OP_PUBKEYS << OP_SMALLINTEGER << OP_CHECKMULTISIG)); } @@ -70,8 +68,8 @@ // it is always OP_HASH160 20 [20 byte hash] OP_EQUAL if (scriptPubKey.IsPayToScriptHash()) { typeRet = TX_SCRIPTHASH; - vector hashBytes(scriptPubKey.begin() + 2, - scriptPubKey.begin() + 22); + std::vector hashBytes(scriptPubKey.begin() + 2, + scriptPubKey.begin() + 22); vSolutionsRet.push_back(hashBytes); return true; } @@ -94,7 +92,7 @@ vSolutionsRet.clear(); opcodetype opcode1, opcode2; - vector vch1, vch2; + std::vector vch1, vch2; // Compare CScript::const_iterator pc1 = script1.begin(); @@ -154,7 +152,7 @@ bool ExtractDestination(const CScript &scriptPubKey, CTxDestination &addressRet) { - vector vSolutions; + std::vector vSolutions; txnouttype whichType; if (!Solver(scriptPubKey, whichType, vSolutions)) return false; @@ -176,11 +174,11 @@ } bool ExtractDestinations(const CScript &scriptPubKey, txnouttype &typeRet, - vector &addressRet, + std::vector &addressRet, int &nRequiredRet) { addressRet.clear(); typeRet = TX_NONSTANDARD; - vector vSolutions; + std::vector vSolutions; if (!Solver(scriptPubKey, typeRet, vSolutions)) return false; if (typeRet == TX_NULL_DATA) { // This is data, not addresses