#undef printf
-#include <boost/algorithm/string.hpp>
#include <ixwebsocket/IXHttpClient.h>
#include <ixwebsocket/IXHttpServer.h>
#include <list>
#include <memory>
+#include <regex>
#define printf OutputDebugStringF
std::string strAuth = mapHeaders["authorization"];
if (strAuth.substr(0,6) != "Basic ")
return false;
- std::string strUserPass64 = strAuth.substr(6); boost::algorithm::trim(strUserPass64);
+ std::string strUserPass64 = std::regex_replace(strAuth.substr(6), static_cast<std::regex>("\\s+"), "");
std::string strUserPass = DecodeBase64(strUserPass64);
return TimingResistantEqual(strUserPass, strRPCUserColonPass);
}
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
-#include <boost/assign/list_of.hpp> // for 'map_list_of()'
-#include <algorithm>
-
#include "checkpoints.h"
-
-#include "txdb-leveldb.h"
#include "main.h"
+#include "txdb-leveldb.h"
#include "uint256.h"
+#include <algorithm>
+
+
namespace Checkpoints
{
typedef std::map<int, std::pair<uint256, unsigned int> > MapCheckpoints;
// + Contains no strange transactions
//
static MapCheckpoints mapCheckpoints =
- boost::assign::map_list_of
- ( 0, std::make_pair(hashGenesisBlock, 1360105017) )
- ( 13560, std::make_pair(uint256("0xa1591a0fcbf11f282d671581edb9f0aadcd06fee69761081e0a3245914c13729"), 1364674052) )
- ( 143990, std::make_pair(uint256("0x00000000001ff5c3940a9f73ad4a990f64955179bde0f743c76dbf0031429efc"), 1418953493) )
- ( 149000, std::make_pair(uint256("0x7a24acfcadcf43054e7f7d9f273522c0dfc5791ba4006e0273e7521a8d36c525"), 1420872125) )
- ( 160000, std::make_pair(uint256("0x000000000001cb1133043d38d077c0e93f66c8b2566779f10f182137d1e34a68"), 1425150237) )
- ( 200000, std::make_pair(uint256("0x0000000000029f8bbf66e6ea6f3e5db55009404aae0fe395a53dd33142b2bff2"), 1441127233) )
- ( 221047, std::make_pair(uint256("0xa28aef712e7aa0c285bfe29351ca21ed416689139e3063ef770fc826a8b9e9da"), 1449431646) )
- ( 243100, std::make_pair(uint256("0x000000000006522d1ebc0734cb0e6b83f5d4da0c3cbc72bd91b82016f611c4f0"), 1458215793) )
- ( 532000, std::make_pair(uint256("0x0000000000018b7eba5e189c41605780c8a855f74144fa837fa05fa4c67b6ba9"), 1569359486) )
- ( 561108, std::make_pair(uint256("0x2f3cf523ae1022300b4f40073e506d15ef0d6e208f123aed5b93016f81a10e1e"), 1580943827) )
- ( 712891, std::make_pair(uint256("0xaaafebcb23c1b8ab49f7517b7a34bcc420cc6f284d9ffc672c1f47b5af2b0088"), 1640557462) )
- ;
+ {
+ { 0, {hashGenesisBlock, 1360105017} },
+ { 13560, {uint256("0xa1591a0fcbf11f282d671581edb9f0aadcd06fee69761081e0a3245914c13729"), 1364674052} },
+ { 143990, {uint256("0x00000000001ff5c3940a9f73ad4a990f64955179bde0f743c76dbf0031429efc"), 1418953493} },
+ { 149000, {uint256("0x7a24acfcadcf43054e7f7d9f273522c0dfc5791ba4006e0273e7521a8d36c525"), 1420872125} },
+ { 160000, {uint256("0x000000000001cb1133043d38d077c0e93f66c8b2566779f10f182137d1e34a68"), 1425150237} },
+ { 200000, {uint256("0x0000000000029f8bbf66e6ea6f3e5db55009404aae0fe395a53dd33142b2bff2"), 1441127233} },
+ { 221047, {uint256("0xa28aef712e7aa0c285bfe29351ca21ed416689139e3063ef770fc826a8b9e9da"), 1449431646} },
+ { 243100, {uint256("0x000000000006522d1ebc0734cb0e6b83f5d4da0c3cbc72bd91b82016f611c4f0"), 1458215793} },
+ { 532000, {uint256("0x0000000000018b7eba5e189c41605780c8a855f74144fa837fa05fa4c67b6ba9"), 1569359486} },
+ { 561108, {uint256("0x2f3cf523ae1022300b4f40073e506d15ef0d6e208f123aed5b93016f81a10e1e"), 1580943827} },
+ { 712891, {uint256("0xaaafebcb23c1b8ab49f7517b7a34bcc420cc6f284d9ffc672c1f47b5af2b0088"), 1640557462} }
+ };
static ListBannedBlocks listBanned =
- boost::assign::list_of
+ {
// Invalid block #221047 with future timestamp of 2016/02/23 09:24:17 UTC
- ( uint256("0x46223e5432ceffe650d5729b4bb8479dcdf0ca1e534fa8e69382dc87b42ea94b") )
- ;
+ uint256("0x46223e5432ceffe650d5729b4bb8479dcdf0ca1e534fa8e69382dc87b42ea94b")
+ };
// TestNet has no checkpoints
static MapCheckpoints mapCheckpointsTestnet =
- boost::assign::map_list_of
- ( 0, std::make_pair(hashGenesisBlockTestNet, 1360105017) )
- ;
+ {
+ { 0, { hashGenesisBlockTestNet, 1360105017 } }
+ };
bool CheckHardened(int nHeight, const uint256& hash)
{
#include "ipcollector.h"
#include "interface.h"
#include "checkpoints.h"
-#include <boost/format.hpp>
+
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/filesystem/convenience.hpp>
#endif
" -paytxfee=<amt> " + _("Fee per KB to add to transactions you send") + "\n" +
- " -mininput=<amt> " + str(boost::format(_("When creating transactions, ignore inputs with value less than this (default: %s)")) % FormatMoney(MIN_TXOUT_AMOUNT)) + "\n" +
+ " -mininput=<amt> " + (_("When creating transactions, ignore inputs with value less than this (default: ") + FormatMoney(MIN_TXOUT_AMOUNT) + ")") + "\n" +
#ifdef QT_GUI
" -server " + _("Accept command line and JSON-RPC commands") + "\n" +
#endif
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
-#include <boost/assign/list_of.hpp>
-
#include "kernel.h"
#include "kernel_worker.h"
#include "txdb-leveldb.h"
// Hard checkpoints of stake modifiers to ensure they are deterministic
static std::map<int, unsigned int> mapStakeModifierCheckpoints =
- boost::assign::map_list_of
- ( 0, 0x0e00670bu )
- ( 12661, 0x5d84115du )
- (143990, 0x9c592c78u )
- (149000, 0x48f2bdc4u )
- (160000, 0x789df0f0u )
- (200000, 0x01ec1503u )
- (221047, 0x0b39ef50u )
- (243100, 0xe928d83au )
- (532000, 0x3e5c2b81u )
- (561108, 0x9c1860b0u )
- (712891, 0xee193895u )
- ;
+ {
+ { 0, 0x0e00670bu },
+ { 12661, 0x5d84115du },
+ {143990, 0x9c592c78u },
+ {149000, 0x48f2bdc4u },
+ {160000, 0x789df0f0u },
+ {200000, 0x01ec1503u },
+ {221047, 0x0b39ef50u },
+ {243100, 0xe928d83au },
+ {532000, 0x3e5c2b81u },
+ {561108, 0x9c1860b0u },
+ {712891, 0xee193895u }
+ };
// Hard checkpoints of stake modifiers to ensure they are deterministic (testNet)
static std::map<int, unsigned int> mapStakeModifierCheckpointsTestNet =
- boost::assign::map_list_of
- ( 0, 0x0e00670bu )
- ;
+ {
+ { 0, 0x0e00670bu }
+ };
// Pregenerated entropy bits table (from genesis to #9689)
//
#include "interface.h"
#include "checkqueue.h"
#include "kernel.h"
-#include <boost/algorithm/string/replace.hpp>
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
#include "main.h"
+#include <regex>
+
using namespace std;
using namespace boost;
std::string strCmd = GetArg("-blocknotify", "");
if (!fIsInitialDownload && !strCmd.empty())
- {
- boost::replace_all(strCmd, "%s", hashBestChain.GetHex());
- boost::thread t(runCommand, strCmd); // thread runs free
- }
+ // thread runs free
+ boost::thread t(runCommand, regex_replace(strCmd, static_cast<std::regex>("%s"), hashBestChain.GetHex()));
return true;
}
static CNode* pnodeSync = NULL;
CAddress addrSeenByPeer(CService("0.0.0.0", nPortZero), nLocalServices);
uint64_t nLocalHostNonce = 0;
-boost::array<int, THREAD_MAX> vnThreadsRunning;
+std::array<int, THREAD_MAX> vnThreadsRunning;
static std::vector<SOCKET> vhListenSocket;
CAddrMan addrman;
#ifndef BITCOIN_NET_H
#define BITCOIN_NET_H
-#include <limits>
-#include <deque>
-#ifndef Q_MOC_RUN
-#include <boost/array.hpp>
-#endif
+#include "mruset.h"
+#include "netbase.h"
+#include "addrman.h"
+#include "hash.h"
+
#include <openssl/rand.h>
#ifndef WIN32
#include <arpa/inet.h>
#endif
-#include "mruset.h"
-#include "netbase.h"
-#include "addrman.h"
-#include "hash.h"
+#include <limits>
+#include <deque>
+
class CRequestTracker;
class CNode;
extern uint64_t nLocalServices;
extern uint64_t nLocalHostNonce;
extern CAddress addrSeenByPeer;
-extern boost::array<int, THREAD_MAX> vnThreadsRunning;
+extern std::array<int, THREAD_MAX> vnThreadsRunning;
extern CAddrMan addrman;
extern std::vector<CNode*> vNodes;
typedef SSIZE_T ssize_t;
#endif
-#include <boost/algorithm/string/case_conv.hpp> // for to_lower()
-#include <boost/algorithm/string/predicate.hpp> // for startswith() and endswith()
using namespace std;
static const unsigned char pchIPv4[12] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff };
enum Network ParseNetwork(std::string net) {
- boost::to_lower(net);
+ transform(net.begin(), net.end(), net.begin(), ::tolower);
if (net == "ipv4") return NET_IPV4;
if (net == "ipv6") return NET_IPV6;
if (net == "tor" || net == "onion") return NET_TOR;
std::string strHost(pszName);
if (strHost.empty())
return false;
- if (boost::algorithm::starts_with(strHost, "[") && boost::algorithm::ends_with(strHost, "]"))
+ if ((strHost.compare(0,1, "[") == 0) && (strHost.compare(strHost.length()-1,1, "]") == 0))
{
strHost = strHost.substr(1, strHost.size() - 2);
}
#include "kernel.h"
#include "bitcoinrpc.h"
-#include <boost/format.hpp>
-#include <boost/assign/list_of.hpp>
-
using namespace json_spirit;
using namespace std;
" days - time window, 90 days by default.\n"
);
- RPCTypeCheck(params, boost::assign::list_of(obj_type));
+ RPCTypeCheck(params, { obj_type });
Object scanParams = params[0].get_obj();
if (nOut < 0 || nOut > (int)tx.vout.size() - 1)
{
stringstream strErrorMsg;
- strErrorMsg << boost::format("Invalid parameter, input number %d is out of range") % nOut;
+ strErrorMsg << "Invalid parameter, input number " << to_string(nOut) << " is out of range";
throw JSONRPCError(RPC_INVALID_PARAMETER, strErrorMsg.str());
}
if (nOut < 0 || nOut > (int)tx.vout.size() - 1)
{
stringstream strErrorMsg;
- strErrorMsg << boost::format("Invalid parameter, input number %d is out of range") % nOut;
+ strErrorMsg << "Invalid parameter, input number " << to_string(nOut) << " is out of range";
throw JSONRPCError(RPC_INVALID_PARAMETER, strErrorMsg.str());
}
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
-#include <boost/assign/list_of.hpp>
-
#include "base58.h"
#include "bitcoinrpc.h"
#include "txdb-leveldb.h"
using namespace std;
using namespace boost;
-using namespace boost::assign;
using namespace json_spirit;
void ScriptPubKeyToJSON(const CScript& scriptPubKey, Object& out, bool fIncludeHex)
"Results are an array of Objects, each of which has:\n"
"{txid, vout, scriptPubKey, amount, confirmations}");
- RPCTypeCheck(params, list_of(int_type)(int_type)(array_type));
+ RPCTypeCheck(params, {int_type, int_type, array_type});
int nMinDepth = 1;
if (params.size() > 0)
"Note that the transaction's inputs are not signed, and\n"
"it is not stored in the wallet or transmitted to the network.");
- RPCTypeCheck(params, list_of(array_type)(obj_type));
+ RPCTypeCheck(params, {array_type, obj_type});
Array inputs = params[0].get_array();
Object sendTo = params[1].get_obj();
"decoderawtransaction <hex string>\n"
"Return a JSON object representing the serialized, hex-encoded transaction.");
- RPCTypeCheck(params, list_of(str_type));
+ RPCTypeCheck(params, {str_type});
vector<unsigned char> txData(ParseHex(params[0].get_str()));
CDataStream ssData(txData, SER_NETWORK, PROTOCOL_VERSION);
"decodescript <hex string>\n"
"Decode a hex-encoded script.");
- RPCTypeCheck(params, list_of(str_type));
+ RPCTypeCheck(params, {str_type});
Object r;
CScript script;
" complete : 1 if transaction has a complete set of signature (0 if not)"
+ HelpRequiringPassphrase());
- RPCTypeCheck(params, list_of(str_type)(array_type)(array_type)(str_type), true);
+ RPCTypeCheck(params, {str_type, array_type, array_type, str_type}, true);
vector<unsigned char> txData(ParseHex(params[0].get_str()));
CDataStream ssData(txData, SER_NETWORK, PROTOCOL_VERSION);
Object prevOut = p.get_obj();
- RPCTypeCheck(prevOut, map_list_of("txid", str_type)("vout", int_type)("scriptPubKey", str_type));
+ RPCTypeCheck(prevOut, {{"txid", str_type}, {"vout", int_type}, {"scriptPubKey", str_type}});
string txidHex = find_value(prevOut, "txid").get_str();
if (!IsHex(txidHex))
Value v = find_value(prevOut, "redeemScript");
if (fGivenKeys && scriptPubKey.IsPayToScriptHash())
{
- RPCTypeCheck(prevOut, map_list_of("txid", str_type)("vout", int_type)("scriptPubKey", str_type)("redeemScript",str_type));
+ RPCTypeCheck(prevOut, {{"txid", str_type}, {"vout", int_type}, {"scriptPubKey", str_type}, {"redeemScript",str_type}});
Value v = find_value(prevOut, "redeemScript");
if (!(v == Value::null))
{
if (params.size() > 3 && params[3].type() != null_type)
{
static map<string, int> mapSigHashValues =
- boost::assign::map_list_of
- (string("ALL"), int(SIGHASH_ALL))
- (string("ALL|ANYONECANPAY"), int(SIGHASH_ALL|SIGHASH_ANYONECANPAY))
- (string("NONE"), int(SIGHASH_NONE))
- (string("NONE|ANYONECANPAY"), int(SIGHASH_NONE|SIGHASH_ANYONECANPAY))
- (string("SINGLE"), int(SIGHASH_SINGLE))
- (string("SINGLE|ANYONECANPAY"), int(SIGHASH_SINGLE|SIGHASH_ANYONECANPAY))
- ;
+ {
+ {"ALL", SIGHASH_ALL},
+ {"ALL|ANYONECANPAY", SIGHASH_ALL|SIGHASH_ANYONECANPAY},
+ {"NONE", SIGHASH_NONE},
+ {"NONE|ANYONECANPAY", SIGHASH_NONE|SIGHASH_ANYONECANPAY},
+ {"SINGLE", SIGHASH_SINGLE},
+ {"SINGLE|ANYONECANPAY", SIGHASH_SINGLE|SIGHASH_ANYONECANPAY}
+ };
string strHashType = params[3].get_str();
if (mapSigHashValues.count(strHashType))
nHashType = mapSigHashValues[strHashType];
"sendrawtransaction <hex string>\n"
"Submits raw transaction (serialized, hex-encoded) to local node and network.");
- RPCTypeCheck(params, list_of(str_type));
+ RPCTypeCheck(params, {str_type});
// parse hex string from parameter
vector<unsigned char> txData(ParseHex(params[0].get_str()));
#include "sync.h"
#include "version.h"
-#include <boost/algorithm/string/join.hpp>
-#include <boost/algorithm/string/case_conv.hpp> // for to_lower()
-#include <boost/algorithm/string/predicate.hpp> // for startswith() and endswith()
#include <boost/program_options/detail/config_file.hpp>
#include <boost/program_options/parsers.hpp>
#include <boost/filesystem.hpp>
str = str.substr(0, is_index);
}
#ifdef WIN32
- boost::to_lower(str);
- if (boost::algorithm::starts_with(str, "/"))
+ std::transform(str.begin(), str.end(), str.begin(), ::tolower);
+ if (str.compare(0,1, "/") == 0)
str = "-" + str.substr(1);
#endif
if (str[0] != '-')
ss << "/";
ss << name << ":" << FormatVersion(nClientVersion);
if (!comments.empty())
- ss << "(" << boost::algorithm::join(comments, "; ") << ")";
+ {
+ ss << "(";
+ for (const auto& st : comments)
+ {
+ ss << st;
+ if (st == comments.back()) break;
+ ss << "; ";
+ }
+ ss << ")";
+ }
ss << "/";
return ss.str();
}
#include "base58.h"
#include "kernel.h"
#include "coincontrol.h"
-#include <boost/algorithm/string/replace.hpp>
+#include "main.h"
+
#include <openssl/bio.h>
+
#include <random>
-#include "main.h"
+#include <regex>
using namespace std;
extern int64_t nReserveBalance;
std::string strCmd = GetArg("-walletnotify", "");
if ( !strCmd.empty())
- {
- boost::replace_all(strCmd, "%s", wtxIn.GetHash().GetHex());
- boost::thread t(runCommand, strCmd); // thread runs free
- }
+ // thread runs free
+ boost::thread t(runCommand, regex_replace(strCmd, static_cast<std::regex>("%s"), wtxIn.GetHash().GetHex()));
}
return true;
#include "wallet.h"
#include "base58.h"
-#include <iostream>
-#include <fstream>
-
#include <boost/version.hpp>
#include <boost/filesystem.hpp>
-#include <boost/algorithm/string.hpp>
-#include <boost/date_time/posix_time/posix_time.hpp>
-#include <boost/lexical_cast.hpp>
-#include <boost/variant/get.hpp>
-#include <boost/algorithm/string.hpp>
+#include <iostream>
+#include <fstream>
using namespace std;
-using namespace boost;
static uint64_t nAccountingEntryNumber = 0;
std::string strLabel;
bool fLabel = true;
for (unsigned int nStr = 2; nStr < vstr.size(); nStr++) {
- if (boost::algorithm::starts_with(vstr[nStr], "#"))
+ if (vstr[nStr].compare(0,1, "#") == 0)
break;
if (vstr[nStr] == "change=1")
fLabel = false;
if (vstr[nStr] == "reserve=1")
fLabel = false;
- if (boost::algorithm::starts_with(vstr[nStr], "label=")) {
+ if (vstr[nStr].compare(0,6, "label=") == 0) {
strLabel = DecodeDumpString(vstr[nStr].substr(6));
fLabel = true;
}