Page MenuHomePhabricator

D461.diff
No OneTemporary

D461.diff

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<unsigned char> valtype;
+typedef std::vector<uint8_t> 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<vector<unsigned char>> &vSolutionsRet) {
+ std::vector<std::vector<uint8_t>> &vSolutionsRet) {
// Templates
- static multimap<txnouttype, CScript> mTemplates;
+ static std::multimap<txnouttype, CScript> 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<unsigned char> hashBytes(scriptPubKey.begin() + 2,
- scriptPubKey.begin() + 22);
+ std::vector<uint8_t> hashBytes(scriptPubKey.begin() + 2,
+ scriptPubKey.begin() + 22);
vSolutionsRet.push_back(hashBytes);
return true;
}
@@ -94,7 +92,7 @@
vSolutionsRet.clear();
opcodetype opcode1, opcode2;
- vector<unsigned char> vch1, vch2;
+ std::vector<uint8_t> vch1, vch2;
// Compare
CScript::const_iterator pc1 = script1.begin();
@@ -154,7 +152,7 @@
bool ExtractDestination(const CScript &scriptPubKey,
CTxDestination &addressRet) {
- vector<valtype> vSolutions;
+ std::vector<valtype> vSolutions;
txnouttype whichType;
if (!Solver(scriptPubKey, whichType, vSolutions)) return false;
@@ -176,11 +174,11 @@
}
bool ExtractDestinations(const CScript &scriptPubKey, txnouttype &typeRet,
- vector<CTxDestination> &addressRet,
+ std::vector<CTxDestination> &addressRet,
int &nRequiredRet) {
addressRet.clear();
typeRet = TX_NONSTANDARD;
- vector<valtype> vSolutions;
+ std::vector<valtype> vSolutions;
if (!Solver(scriptPubKey, typeRet, vSolutions)) return false;
if (typeRet == TX_NULL_DATA) {
// This is data, not addresses

File Metadata

Mime Type
text/plain
Expires
Sat, Mar 1, 09:30 (1 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5187209
Default Alt Text
D461.diff (3 KB)

Event Timeline