diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp --- a/src/bitcoin-tx.cpp +++ b/src/bitcoin-tx.cpp @@ -24,7 +24,6 @@ #include #include -#include static bool fCreateBlank; static std::map registers; @@ -608,9 +607,10 @@ throw std::runtime_error("expected prevtxs internal object"); } - std::map types = - boost::assign::map_list_of("txid", UniValue::VSTR)( - "vout", UniValue::VNUM)("scriptPubKey", UniValue::VSTR); + std::map types = { + {"txid", UniValue::VSTR}, + {"vout", UniValue::VNUM}, + {"scriptPubKey", UniValue::VSTR}}; if (!prevOut.checkObject(types)) { throw std::runtime_error("prevtxs internal object typecheck fail"); } diff --git a/src/chainparams.cpp b/src/chainparams.cpp --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -12,8 +12,6 @@ #include -#include - #include "chainparamsseeds.h" // Far into the future. @@ -192,12 +190,8 @@ base58Prefixes[PUBKEY_ADDRESS] = std::vector(1, 0); base58Prefixes[SCRIPT_ADDRESS] = std::vector(1, 5); base58Prefixes[SECRET_KEY] = std::vector(1, 128); - base58Prefixes[EXT_PUBLIC_KEY] = - boost::assign::list_of(0x04)(0x88)(0xB2)(0x1E) - .convert_to_container>(); - base58Prefixes[EXT_SECRET_KEY] = - boost::assign::list_of(0x04)(0x88)(0xAD)(0xE4) - .convert_to_container>(); + base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x88, 0xB2, 0x1E}; + base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x88, 0xAD, 0xE4}; vFixedSeeds = std::vector( pnSeed6_main, pnSeed6_main + ARRAYLEN(pnSeed6_main)); @@ -207,35 +201,50 @@ fRequireStandard = true; fMineBlocksOnDemand = false; - checkpointData = (CCheckpointData){boost::assign::map_list_of( - 11111, uint256S("0x0000000069e244f73d78e8fd29ba2fd2ed618bd6fa2ee925" - "59f542fdb26e7c1d"))( - 33333, uint256S("0x000000002dd5588a74784eaa7ab0507a18ad16a236e7b1ce" - "69f00d7ddfb5d0a6"))( - 74000, uint256S("0x0000000000573993a3c9e41ce34471c079dcf5f52a0e824a" - "81e7f953b8661a20"))( - 105000, uint256S("0x00000000000291ce28027faea320c8d2b054b2e0fe44a77" - "3f3eefb151d6bdc97"))( - 134444, uint256S("0x00000000000005b12ffd4cd315cd34ffd4a594f430ac814" - "c91184a0d42d2b0fe"))( - 168000, uint256S("0x000000000000099e61ea72015e79632f216fe6cb33d7899" - "acb35b75c8303b763"))( - 193000, uint256S("0x000000000000059f452a5f7340de6682a977387c17010ff" - "6e6c3bd83ca8b1317"))( - 210000, uint256S("0x000000000000048b95347e83192f69cf0366076336c639f" - "9b7228e9ba171342e"))( - 216116, uint256S("0x00000000000001b4f4b433e81ee46494af945cf96014816" - "a4e2370f11b23df4e"))( - 225430, uint256S("0x00000000000001c108384350f74090433e7fcf79a606b8e" - "797f065b130575932"))( - 250000, uint256S("0x000000000000003887df1f29024b06fc2200b55f8af8f35" - "453d7be294df2d214"))( - 279000, uint256S("0x0000000000000001ae8c72a0b0c301f67e3afca10e819ef" - "a9041e458e9bd7e40"))( - 295000, uint256S("0x00000000000000004d9b4ef50f0f9d686fd69db2e03af35" - "a100370c64632a983"))( - 478641, uint256S("0x0000000000000000027c1fea6fe49acb16d46c82dd2f2a8" - "0b22ecc9cdb3ababe"))}; + checkpointData = { + .mapCheckpoints = { + {11111, + uint256S("0x0000000069e244f73d78e8fd29ba2fd2ed618bd6fa2ee925" + "59f542fdb26e7c1d")}, + {33333, + uint256S("0x000000002dd5588a74784eaa7ab0507a18ad16a236e7b1ce" + "69f00d7ddfb5d0a6")}, + {74000, + uint256S("0x0000000000573993a3c9e41ce34471c079dcf5f52a0e824a" + "81e7f953b8661a20")}, + {105000, + uint256S("0x00000000000291ce28027faea320c8d2b054b2e0fe44a77" + "3f3eefb151d6bdc97")}, + {134444, + uint256S("0x00000000000005b12ffd4cd315cd34ffd4a594f430ac814" + "c91184a0d42d2b0fe")}, + {168000, + uint256S("0x000000000000099e61ea72015e79632f216fe6cb33d7899" + "acb35b75c8303b763")}, + {193000, + uint256S("0x000000000000059f452a5f7340de6682a977387c17010ff" + "6e6c3bd83ca8b1317")}, + {210000, + uint256S("0x000000000000048b95347e83192f69cf0366076336c639f" + "9b7228e9ba171342e")}, + {216116, + uint256S("0x00000000000001b4f4b433e81ee46494af945cf96014816" + "a4e2370f11b23df4e")}, + {225430, + uint256S("0x00000000000001c108384350f74090433e7fcf79a606b8e" + "797f065b130575932")}, + {250000, + uint256S("0x000000000000003887df1f29024b06fc2200b55f8af8f35" + "453d7be294df2d214")}, + {279000, + uint256S("0x0000000000000001ae8c72a0b0c301f67e3afca10e819ef" + "a9041e458e9bd7e40")}, + {295000, + uint256S("0x00000000000000004d9b4ef50f0f9d686fd69db2e03af35" + "a100370c64632a983")}, + {478641, + uint256S("0x0000000000000000027c1fea6fe49acb16d46c82dd2f2a8" + "0b22ecc9cdb3ababe")}}}; // Data as of block // 00000000000000000166d612d5595e2b1cd88d71d695fc580af64d8da8658c23 @@ -354,13 +363,8 @@ base58Prefixes[PUBKEY_ADDRESS] = std::vector(1, 111); base58Prefixes[SCRIPT_ADDRESS] = std::vector(1, 196); base58Prefixes[SECRET_KEY] = std::vector(1, 239); - base58Prefixes[EXT_PUBLIC_KEY] = - boost::assign::list_of(0x04)(0x35)(0x87)(0xCF) - .convert_to_container>(); - base58Prefixes[EXT_SECRET_KEY] = - boost::assign::list_of(0x04)(0x35)(0x83)(0x94) - .convert_to_container>(); - + base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x35, 0x87, 0xCF}; + base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x35, 0x83, 0x94}; vFixedSeeds = std::vector( pnSeed6_test, pnSeed6_test + ARRAYLEN(pnSeed6_test)); @@ -369,11 +373,12 @@ fRequireStandard = false; fMineBlocksOnDemand = false; - checkpointData = (CCheckpointData){ - boost::assign::map_list_of( - 546, uint256S("000000002a936ca763904c3c35fce2f3556c559c0214345d" - "31b1bcebf76acb70")), - }; + checkpointData = { + .mapCheckpoints = { + {546, + uint256S("000000002a936ca763904c3c35fce2f3556c559c0214345d" + "31b1bcebf76acb70")}, + }}; // Data as of block // 00000000c2872f8f8a8935c8e3c5862be9038c97d4de2cf37ed496991166928a @@ -458,21 +463,19 @@ fRequireStandard = false; fMineBlocksOnDemand = true; - checkpointData = (CCheckpointData){boost::assign::map_list_of( - 0, uint256S("0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a" - "11466e2206"))}; + checkpointData = { + .mapCheckpoints = { + {0, uint256S( + "0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a" + "11466e2206")}}}; chainTxData = ChainTxData{0, 0, 0}; base58Prefixes[PUBKEY_ADDRESS] = std::vector(1, 111); base58Prefixes[SCRIPT_ADDRESS] = std::vector(1, 196); base58Prefixes[SECRET_KEY] = std::vector(1, 239); - base58Prefixes[EXT_PUBLIC_KEY] = - boost::assign::list_of(0x04)(0x35)(0x87)(0xCF) - .convert_to_container>(); - base58Prefixes[EXT_SECRET_KEY] = - boost::assign::list_of(0x04)(0x35)(0x83)(0x94) - .convert_to_container>(); + base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x35, 0x87, 0xCF}; + base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x35, 0x83, 0x94}; } void UpdateBIP9Parameters(Consensus::DeploymentPos d, int64_t nStartTime, diff --git a/src/core_read.cpp b/src/core_read.cpp --- a/src/core_read.cpp +++ b/src/core_read.cpp @@ -19,7 +19,6 @@ #include #include #include -#include CScript ParseScript(const std::string &s) { CScript result; diff --git a/src/core_write.cpp b/src/core_write.cpp --- a/src/core_write.cpp +++ b/src/core_write.cpp @@ -16,8 +16,6 @@ #include -#include - std::string FormatScript(const CScript &script) { std::string ret; CScript::const_iterator it = script.begin(); @@ -61,32 +59,30 @@ return ret.substr(0, ret.size() - 1); } -const std::map mapSigHashTypes = - boost::assign::map_list_of(static_cast(SIGHASH_ALL), - std::string("ALL"))( - static_cast(SIGHASH_ALL | SIGHASH_ANYONECANPAY), - std::string("ALL|ANYONECANPAY"))( - static_cast(SIGHASH_ALL | SIGHASH_FORKID), - std::string("ALL|FORKID"))(static_cast(SIGHASH_ALL | - SIGHASH_FORKID | - SIGHASH_ANYONECANPAY), - std::string("ALL|FORKID|ANYONECANPAY"))( - static_cast(SIGHASH_NONE), std::string("NONE"))( - static_cast(SIGHASH_NONE | SIGHASH_ANYONECANPAY), - std::string("NONE|ANYONECANPAY"))( - static_cast(SIGHASH_NONE | SIGHASH_FORKID), - std::string("NONE|FORKID"))(static_cast(SIGHASH_NONE | - SIGHASH_FORKID | - SIGHASH_ANYONECANPAY), - std::string("NONE|FORKID|ANYONECANPAY"))( - static_cast(SIGHASH_SINGLE), std::string("SINGLE"))( - static_cast(SIGHASH_SINGLE | SIGHASH_ANYONECANPAY), - std::string("SINGLE|ANYONECANPAY"))( - static_cast(SIGHASH_SINGLE | SIGHASH_FORKID), - std::string("SINGLE|FORKID"))( - static_cast(SIGHASH_SINGLE | SIGHASH_FORKID | - SIGHASH_ANYONECANPAY), - std::string("SINGLE|FORKID|ANYONECANPAY")); +const std::map mapSigHashTypes = { + {static_cast(SIGHASH_ALL), std::string("ALL")}, + {static_cast(SIGHASH_ALL | SIGHASH_ANYONECANPAY), + std::string("ALL|ANYONECANPAY")}, + {static_cast(SIGHASH_ALL | SIGHASH_FORKID), + std::string("ALL|FORKID")}, + {static_cast(SIGHASH_ALL | SIGHASH_FORKID | SIGHASH_ANYONECANPAY), + std::string("ALL|FORKID|ANYONECANPAY")}, + {static_cast(SIGHASH_NONE), std::string("NONE")}, + {static_cast(SIGHASH_NONE | SIGHASH_ANYONECANPAY), + std::string("NONE|ANYONECANPAY")}, + {static_cast(SIGHASH_NONE | SIGHASH_FORKID), + std::string("NONE|FORKID")}, + {static_cast(SIGHASH_NONE | SIGHASH_FORKID | SIGHASH_ANYONECANPAY), + std::string("NONE|FORKID|ANYONECANPAY")}, + {static_cast(SIGHASH_SINGLE), std::string("SINGLE")}, + {static_cast(SIGHASH_SINGLE | SIGHASH_ANYONECANPAY), + std::string("SINGLE|ANYONECANPAY")}, + {static_cast(SIGHASH_SINGLE | SIGHASH_FORKID), + std::string("SINGLE|FORKID")}, + {static_cast(SIGHASH_SINGLE | SIGHASH_FORKID | + SIGHASH_ANYONECANPAY), + std::string("SINGLE|FORKID|ANYONECANPAY")}, +}; /** * Create the assembly string representation of a CScript object. diff --git a/src/qt/coincontroldialog.cpp b/src/qt/coincontroldialog.cpp --- a/src/qt/coincontroldialog.cpp +++ b/src/qt/coincontroldialog.cpp @@ -19,8 +19,6 @@ #include "wallet/coincontrol.h" #include "wallet/wallet.h" -#include // for 'map_list_of()' - #include #include #include diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -26,7 +26,6 @@ #include #include -#include #include #include @@ -936,7 +935,7 @@ HelpExampleCli("estimatefee", "6")); } - RPCTypeCheck(request.params, boost::assign::list_of(UniValue::VNUM)); + RPCTypeCheck(request.params, {UniValue::VNUM}); int nBlocks = request.params[0].get_int(); if (nBlocks < 1) { @@ -971,7 +970,7 @@ HelpExampleCli("estimatepriority", "6")); } - RPCTypeCheck(request.params, boost::assign::list_of(UniValue::VNUM)); + RPCTypeCheck(request.params, {UniValue::VNUM}); int nBlocks = request.params[0].get_int(); if (nBlocks < 1) { @@ -1011,7 +1010,7 @@ HelpExampleCli("estimatesmartfee", "6")); } - RPCTypeCheck(request.params, boost::assign::list_of(UniValue::VNUM)); + RPCTypeCheck(request.params, {UniValue::VNUM}); int nBlocks = request.params[0].get_int(); @@ -1055,7 +1054,7 @@ HelpExampleCli("estimatesmartpriority", "6")); } - RPCTypeCheck(request.params, boost::assign::list_of(UniValue::VNUM)); + RPCTypeCheck(request.params, {UniValue::VNUM}); int nBlocks = request.params[0].get_int(); diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp --- a/src/rpc/misc.cpp +++ b/src/rpc/misc.cpp @@ -23,8 +23,6 @@ #include -#include - #include /** @@ -514,7 +512,7 @@ // ensure all callsites of GetTime() are accessing this safely. LOCK(cs_main); - RPCTypeCheck(request.params, boost::assign::list_of(UniValue::VNUM)); + RPCTypeCheck(request.params, {UniValue::VNUM}); SetMockTime(request.params[0].get_int64()); return NullUniValue; diff --git a/src/test/DoS_tests.cpp b/src/test/DoS_tests.cpp --- a/src/test/DoS_tests.cpp +++ b/src/test/DoS_tests.cpp @@ -19,7 +19,6 @@ #include -#include // for 'map_list_of()' #include #include diff --git a/src/test/crypto_tests.cpp b/src/test/crypto_tests.cpp --- a/src/test/crypto_tests.cpp +++ b/src/test/crypto_tests.cpp @@ -15,7 +15,6 @@ #include -#include #include #include #include diff --git a/src/test/netbase_tests.cpp b/src/test/netbase_tests.cpp --- a/src/test/netbase_tests.cpp +++ b/src/test/netbase_tests.cpp @@ -7,7 +7,6 @@ #include -#include #include BOOST_FIXTURE_TEST_SUITE(netbase_tests, BasicTestingSetup) @@ -277,33 +276,33 @@ BOOST_AUTO_TEST_CASE(netbase_getgroup) { BOOST_CHECK(ResolveIP("127.0.0.1").GetGroup() == - boost::assign::list_of(0)); // Local -> !Routable() + std::vector({0})); // Local -> !Routable() BOOST_CHECK(ResolveIP("257.0.0.1").GetGroup() == - boost::assign::list_of(0)); // !Valid -> !Routable() + std::vector({0})); // !Valid -> !Routable() BOOST_CHECK(ResolveIP("10.0.0.1").GetGroup() == - boost::assign::list_of(0)); // RFC1918 -> !Routable() + std::vector({0})); // RFC1918 -> !Routable() BOOST_CHECK(ResolveIP("169.254.1.1").GetGroup() == - boost::assign::list_of(0)); // RFC3927 -> !Routable() + std::vector({0})); // RFC3927 -> !Routable() BOOST_CHECK(ResolveIP("1.2.3.4").GetGroup() == - boost::assign::list_of((uint8_t)NET_IPV4)(1)(2)); // IPv4 + std::vector({uint8_t(NET_IPV4), 1, 2})); // IPv4 BOOST_CHECK(ResolveIP("::FFFF:0:102:304").GetGroup() == - boost::assign::list_of((uint8_t)NET_IPV4)(1)(2)); // RFC6145 + std::vector({uint8_t(NET_IPV4), 1, 2})); // RFC6145 BOOST_CHECK(ResolveIP("64:FF9B::102:304").GetGroup() == - boost::assign::list_of((uint8_t)NET_IPV4)(1)(2)); // RFC6052 + std::vector({(uint8_t)NET_IPV4, 1, 2})); // RFC6052 BOOST_CHECK(ResolveIP("2002:102:304:9999:9999:9999:9999:9999").GetGroup() == - boost::assign::list_of((uint8_t)NET_IPV4)(1)(2)); // RFC3964 + std::vector({(uint8_t)NET_IPV4, 1, 2})); // RFC3964 BOOST_CHECK(ResolveIP("2001:0:9999:9999:9999:9999:FEFD:FCFB").GetGroup() == - boost::assign::list_of((uint8_t)NET_IPV4)(1)(2)); // RFC4380 + std::vector({(uint8_t)NET_IPV4, 1, 2})); // RFC4380 BOOST_CHECK( ResolveIP("FD87:D87E:EB43:edb1:8e4:3588:e546:35ca").GetGroup() == - boost::assign::list_of((uint8_t)NET_TOR)(239)); // Tor + std::vector({(uint8_t)NET_TOR, 239})); // Tor BOOST_CHECK( ResolveIP("2001:470:abcd:9999:9999:9999:9999:9999").GetGroup() == - boost::assign::list_of((uint8_t)NET_IPV6)(32)(1)(4)(112)( - 175)); // he.net + std::vector( + {(uint8_t)NET_IPV6, 32, 1, 4, 112, 175})); // he.net BOOST_CHECK( ResolveIP("2001:2001:9999:9999:9999:9999:9999:9999").GetGroup() == - boost::assign::list_of((uint8_t)NET_IPV6)(32)(1)(32)(1)); // IPv6 + std::vector({(uint8_t)NET_IPV6, 32, 1, 32, 1})); // IPv6 } BOOST_AUTO_TEST_SUITE_END() diff --git a/src/test/pmt_tests.cpp b/src/test/pmt_tests.cpp --- a/src/test/pmt_tests.cpp +++ b/src/test/pmt_tests.cpp @@ -14,7 +14,6 @@ #include -#include #include class CPartialMerkleTreeTester : public CPartialMerkleTree { @@ -113,13 +112,13 @@ } BOOST_AUTO_TEST_CASE(pmt_malleability) { - std::vector vTxid = boost::assign::list_of(ArithToUint256(1))( - ArithToUint256(2))(ArithToUint256(3))(ArithToUint256(4))( - ArithToUint256(5))(ArithToUint256(6))(ArithToUint256(7))( - ArithToUint256(8))(ArithToUint256(9))(ArithToUint256(10))( - ArithToUint256(9))(ArithToUint256(10)); - std::vector vMatch = boost::assign::list_of(false)(false)(false)( - false)(false)(false)(false)(false)(false)(true)(true)(false); + std::vector vTxid = { + ArithToUint256(1), ArithToUint256(2), ArithToUint256(3), + ArithToUint256(4), ArithToUint256(5), ArithToUint256(6), + ArithToUint256(7), ArithToUint256(8), ArithToUint256(9), + ArithToUint256(10), ArithToUint256(9), ArithToUint256(10)}; + std::vector vMatch = {false, false, false, false, false, false, + false, false, false, true, true, false}; CPartialMerkleTree tree(vTxid, vMatch); std::vector vIndex; diff --git a/src/test/rpc_tests.cpp b/src/test/rpc_tests.cpp --- a/src/test/rpc_tests.cpp +++ b/src/test/rpc_tests.cpp @@ -12,7 +12,6 @@ #include "test/test_bitcoin.h" #include -#include #include #include @@ -484,26 +483,23 @@ BOOST_AUTO_TEST_CASE(rpc_convert_values_generatetoaddress) { UniValue result; - BOOST_CHECK_NO_THROW( - result = RPCConvertValues("generatetoaddress", - boost::assign::list_of("101")( - "mkESjLZW66TmHhiFX8MCaBjrhZ543PPh9a"))); + BOOST_CHECK_NO_THROW(result = RPCConvertValues( + "generatetoaddress", + {"101", "mkESjLZW66TmHhiFX8MCaBjrhZ543PPh9a"})); BOOST_CHECK_EQUAL(result[0].get_int(), 101); BOOST_CHECK_EQUAL(result[1].get_str(), "mkESjLZW66TmHhiFX8MCaBjrhZ543PPh9a"); - BOOST_CHECK_NO_THROW( - result = RPCConvertValues("generatetoaddress", - boost::assign::list_of("101")( - "mhMbmE2tE9xzJYCV9aNC8jKWN31vtGrguU"))); + BOOST_CHECK_NO_THROW(result = RPCConvertValues( + "generatetoaddress", + {"101", "mhMbmE2tE9xzJYCV9aNC8jKWN31vtGrguU"})); BOOST_CHECK_EQUAL(result[0].get_int(), 101); BOOST_CHECK_EQUAL(result[1].get_str(), "mhMbmE2tE9xzJYCV9aNC8jKWN31vtGrguU"); BOOST_CHECK_NO_THROW(result = RPCConvertValues( "generatetoaddress", - boost::assign::list_of("1")( - "mkESjLZW66TmHhiFX8MCaBjrhZ543PPh9a")("9"))); + {"1", "mkESjLZW66TmHhiFX8MCaBjrhZ543PPh9a", "9"})); BOOST_CHECK_EQUAL(result[0].get_int(), 1); BOOST_CHECK_EQUAL(result[1].get_str(), "mkESjLZW66TmHhiFX8MCaBjrhZ543PPh9a"); @@ -511,8 +507,7 @@ BOOST_CHECK_NO_THROW(result = RPCConvertValues( "generatetoaddress", - boost::assign::list_of("1")( - "mhMbmE2tE9xzJYCV9aNC8jKWN31vtGrguU")("9"))); + {"1", "mhMbmE2tE9xzJYCV9aNC8jKWN31vtGrguU", "9"})); BOOST_CHECK_EQUAL(result[0].get_int(), 1); BOOST_CHECK_EQUAL(result[1].get_str(), "mhMbmE2tE9xzJYCV9aNC8jKWN31vtGrguU"); diff --git a/src/test/scriptflags.cpp b/src/test/scriptflags.cpp --- a/src/test/scriptflags.cpp +++ b/src/test/scriptflags.cpp @@ -8,37 +8,35 @@ #include #include -#include #include #include #include -static std::map mapFlagNames = - boost::assign::map_list_of(std::string("NONE"), - (unsigned int)SCRIPT_VERIFY_NONE)( - std::string("P2SH"), (unsigned int)SCRIPT_VERIFY_P2SH)( - std::string("STRICTENC"), (unsigned int)SCRIPT_VERIFY_STRICTENC)( - std::string("DERSIG"), (unsigned int)SCRIPT_VERIFY_DERSIG)( - std::string("LOW_S"), (unsigned int)SCRIPT_VERIFY_LOW_S)( - std::string("SIGPUSHONLY"), (unsigned int)SCRIPT_VERIFY_SIGPUSHONLY)( - std::string("MINIMALDATA"), (unsigned int)SCRIPT_VERIFY_MINIMALDATA)( - std::string("NULLDUMMY"), (unsigned int)SCRIPT_VERIFY_NULLDUMMY)( - std::string("DISCOURAGE_UPGRADABLE_NOPS"), - (unsigned int)SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)( - std::string("CLEANSTACK"), (unsigned int)SCRIPT_VERIFY_CLEANSTACK)( - std::string("MINIMALIF"), (unsigned int)SCRIPT_VERIFY_MINIMALIF)( - std::string("NULLFAIL"), (unsigned int)SCRIPT_VERIFY_NULLFAIL)( - std::string("CHECKLOCKTIMEVERIFY"), - (unsigned int)SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY)( - std::string("CHECKSEQUENCEVERIFY"), - (unsigned int)SCRIPT_VERIFY_CHECKSEQUENCEVERIFY)( - std::string("DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM"), - (unsigned int)SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM)( - std::string("COMPRESSED_PUBKEYTYPE"), - (unsigned int)SCRIPT_VERIFY_COMPRESSED_PUBKEYTYPE)( - std::string("SIGHASH_FORKID"), - (unsigned int)SCRIPT_ENABLE_SIGHASH_FORKID); +static std::map mapFlagNames = { + {std::string("NONE"), (unsigned int)SCRIPT_VERIFY_NONE}, + {std::string("P2SH"), (unsigned int)SCRIPT_VERIFY_P2SH}, + {std::string("STRICTENC"), (unsigned int)SCRIPT_VERIFY_STRICTENC}, + {std::string("DERSIG"), (unsigned int)SCRIPT_VERIFY_DERSIG}, + {std::string("LOW_S"), (unsigned int)SCRIPT_VERIFY_LOW_S}, + {std::string("SIGPUSHONLY"), (unsigned int)SCRIPT_VERIFY_SIGPUSHONLY}, + {std::string("MINIMALDATA"), (unsigned int)SCRIPT_VERIFY_MINIMALDATA}, + {std::string("NULLDUMMY"), (unsigned int)SCRIPT_VERIFY_NULLDUMMY}, + {std::string("DISCOURAGE_UPGRADABLE_NOPS"), + (unsigned int)SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS}, + {std::string("CLEANSTACK"), (unsigned int)SCRIPT_VERIFY_CLEANSTACK}, + {std::string("MINIMALIF"), (unsigned int)SCRIPT_VERIFY_MINIMALIF}, + {std::string("NULLFAIL"), (unsigned int)SCRIPT_VERIFY_NULLFAIL}, + {std::string("CHECKLOCKTIMEVERIFY"), + (unsigned int)SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY}, + {std::string("CHECKSEQUENCEVERIFY"), + (unsigned int)SCRIPT_VERIFY_CHECKSEQUENCEVERIFY}, + {std::string("DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM"), + (unsigned int)SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM}, + {std::string("COMPRESSED_PUBKEYTYPE"), + (unsigned int)SCRIPT_VERIFY_COMPRESSED_PUBKEYTYPE}, + {std::string("SIGHASH_FORKID"), + (unsigned int)SCRIPT_ENABLE_SIGHASH_FORKID}}; unsigned int ParseScriptFlags(std::string strFlags) { if (strFlags.empty()) { diff --git a/src/wallet/rpcdump.cpp b/src/wallet/rpcdump.cpp --- a/src/wallet/rpcdump.cpp +++ b/src/wallet/rpcdump.cpp @@ -24,8 +24,6 @@ #include -#include - void EnsureWalletIsUnlocked(); bool EnsureWalletIsAvailable(bool avoidException); @@ -1125,8 +1123,7 @@ return NullUniValue; } - RPCTypeCheck(mainRequest.params, - boost::assign::list_of(UniValue::VARR)(UniValue::VOBJ)); + RPCTypeCheck(mainRequest.params, {UniValue::VARR, UniValue::VOBJ}); const UniValue &requests = mainRequest.params[0]; diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -23,8 +23,6 @@ #include -#include - #include int64_t nWalletUnlockTime; @@ -2717,10 +2715,9 @@ LOCK2(cs_main, pwalletMain->cs_wallet); if (request.params.size() == 1) { - RPCTypeCheck(request.params, boost::assign::list_of(UniValue::VBOOL)); + RPCTypeCheck(request.params, {UniValue::VBOOL}); } else { - RPCTypeCheck(request.params, - boost::assign::list_of(UniValue::VBOOL)(UniValue::VARR)); + RPCTypeCheck(request.params, {UniValue::VBOOL, UniValue::VARR}); } bool fUnlock = request.params[0].get_bool(); @@ -3215,7 +3212,7 @@ HelpExampleCli("sendrawtransaction", "\"signedtransactionhex\"")); } - RPCTypeCheck(request.params, boost::assign::list_of(UniValue::VSTR)); + RPCTypeCheck(request.params, {UniValue::VSTR}); CTxDestination changeAddress = CNoDestination(); int changePosition = -1; @@ -3232,8 +3229,7 @@ // backward compatibility bool only fallback includeWatching = request.params[1].get_bool(); } else { - RPCTypeCheck(request.params, boost::assign::list_of(UniValue::VSTR)( - UniValue::VOBJ)); + RPCTypeCheck(request.params, {UniValue::VSTR, UniValue::VOBJ}); UniValue options = request.params[1];